2019-04-05 23:07:43 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2019-04-14 16:46:20 +09:00
|
|
|
use Staudenmeir\EloquentEagerLimit\HasEagerLimit;
|
2019-04-05 23:07:43 +09:00
|
|
|
|
|
|
|
class Like extends Model
|
|
|
|
{
|
2019-04-14 16:46:20 +09:00
|
|
|
use HasEagerLimit;
|
|
|
|
|
2019-04-05 23:07:43 +09:00
|
|
|
protected $fillable = ['user_id', 'ejaculation_id'];
|
|
|
|
|
|
|
|
public function user()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(User::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function ejaculation()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Ejaculation::class)->withLikes();
|
|
|
|
}
|
|
|
|
}
|