Add variations, slider, fix cart ...

This commit is contained in:
Ludovic CANDELLIER
2022-03-21 21:52:12 +01:00
parent 0eaa11b2a9
commit ddc5f2664c
27 changed files with 438 additions and 81 deletions

View File

@@ -24,12 +24,13 @@ class Category extends parentCategory
protected $guarded = ['id'];
protected $table = 'categories';
public $translatable = ['name', 'description'];
public $translatable = [];
protected $cascadeDeleteMorph = ['Articles'];
protected $fillable = [
'visible',
'homepage',
'slug',
'name',
'visible',
'description',
NestedSet::LFT,
NestedSet::RGT,
@@ -61,4 +62,14 @@ class Category extends parentCategory
{
return $query->where('visible', 1);
}
public function scopeHomepage($query)
{
return $query->where('homepage', 1);
}
public function scopeNotRoot($query)
{
return $query->where('id', '<>', 1);
}
}