Refactor article getter for descriptions & tags, minor fixes on tags
This commit is contained in:
@@ -24,8 +24,18 @@ class Merchandise extends Model implements HasMedia
|
||||
return $this->morphMany(Article::class, 'product');
|
||||
}
|
||||
|
||||
public function Producer()
|
||||
{
|
||||
return $this->belongsTo(Producer::class);
|
||||
}
|
||||
|
||||
public function tags()
|
||||
{
|
||||
return $this->morphToMany(Tag::class, 'taggable');
|
||||
}
|
||||
|
||||
public function scopeByProducer($query, $producer_id)
|
||||
{
|
||||
return $query->where('producer_id', $producer_id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user