Like APIの追加
This commit is contained in:
20
app/Like.php
Normal file
20
app/Like.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Like extends Model
|
||||
{
|
||||
protected $fillable = ['user_id', 'ejaculation_id'];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function ejaculation()
|
||||
{
|
||||
return $this->belongsTo(Ejaculation::class)->withLikes();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user