1 | <?php |
||
15 | class Category extends Repository |
||
16 | { |
||
17 | use HasTranslations, |
||
18 | ActivateableTrait, |
||
19 | RankedableTrait, |
||
20 | HasImages, |
||
21 | Presenterable, |
||
22 | HasFilters; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $table = 'categories'; |
||
28 | |||
29 | /** |
||
30 | * @var CategoryPresenter |
||
31 | */ |
||
32 | protected $presenter = CategoryPresenter::class; |
||
33 | |||
34 | /** |
||
35 | * @var CategoryTranslation |
||
36 | */ |
||
37 | public $translationModel = CategoryTranslation::class; |
||
38 | |||
39 | /** |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $fillable = ['tax', 'active', 'show_in_footer', 'show_in_sidebar', 'rank']; |
||
43 | |||
44 | /** |
||
45 | * @var array |
||
46 | */ |
||
47 | public $translatedAttributes = ['name', 'slug', 'seo_title', 'seo_description', 'seo_keywords']; |
||
48 | |||
49 | /** |
||
50 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
51 | */ |
||
52 | public function subCategories() |
||
56 | |||
57 | /** |
||
58 | * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough |
||
59 | */ |
||
60 | public function products() |
||
67 | |||
68 | /** |
||
69 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
70 | */ |
||
71 | public function categoryables() |
||
75 | |||
76 | /** |
||
77 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
78 | */ |
||
79 | public function tags() |
||
83 | } |