Add method to get offers by articles with siblings, enhance display

This commit is contained in:
Ludovic CANDELLIER
2022-01-30 22:48:04 +01:00
parent 5e5f12ddb2
commit b4856266c8
11 changed files with 129 additions and 60 deletions

View File

@@ -50,6 +50,11 @@ class Article extends Model implements HasMedia
return $this->morphTo();
}
public function siblings()
{
return $this->hasMany(Article::class, 'name', 'name');
}
public function tags()
{
return $this->morphToMany(Tag::class, 'taggable');