invert query from offers->articles to articles->offers

This commit is contained in:
Ludovic CANDELLIER
2022-01-05 22:05:30 +01:00
parent a3c6fc6ebe
commit 95ca3c6404
17 changed files with 121 additions and 93 deletions

View File

@@ -14,9 +14,11 @@ use Spatie\Translatable\HasTranslations;
use Rinvex\Tags\Traits\Taggable;
use Wildside\Userstamps\Userstamps;
use Kalnoy\Nestedset\NodeTrait;
class Category extends Model
{
use HasTranslations, InteractsWithMedia, SoftDeletes, Taggable, Userstamps;
use HasTranslations, InteractsWithMedia, NodeTrait, SoftDeletes, Taggable, Userstamps;
protected $guarded = ['id'];
protected $table = 'categories';
@@ -41,4 +43,9 @@ class Category extends Model
{
return $query->where('category_id', $category_id);
}
public function scopeVisible($query)
{
return $query->where('visible', 1);
}
}