Metadata - Tags の多対多リレーション追加

This commit is contained in:
shibafu
2019-04-29 11:40:03 +09:00
parent 91c786199a
commit 1322e89b86
2 changed files with 38 additions and 0 deletions

View File

@@ -14,4 +14,9 @@ class Metadata extends Model
protected $visible = ['url', 'title', 'description', 'image', 'expires_at'];
protected $dates = ['created_at', 'updated_at', 'expires_at'];
public function tags()
{
return $this->belongsToMany(Tag::class)->withTimestamps();
}
}