Add new filters to display on website
This commit is contained in:
@@ -43,7 +43,7 @@ class Article extends Model implements HasMedia
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo($this->model, 'model_id');
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
public function scopeByArticle($query, $id)
|
||||
@@ -51,4 +51,15 @@ class Article extends Model implements HasMedia
|
||||
return $query->where('shop_articles.id',$id);
|
||||
}
|
||||
|
||||
public function scopeByCategory($query, $category_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function scopeByFamily($query, $id)
|
||||
{
|
||||
return $query->where('shop_articles.article_family_id',$id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user