Like APIの追加

This commit is contained in:
shibafu committed 2019-04-05 23:10:44 +09:00
1 parent 212fad4d66
commit 34b7cd6c89
5 files changed
+138

No files matched your search

+20
View 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();
}
}