Total Complexity | 3 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class ShopCategory extends Model |
||
8 | { |
||
9 | use Sluggable, |
||
|
|||
10 | ShopCategoryPresenter; |
||
11 | |||
12 | /** |
||
13 | * The attributes that are mass assignable. |
||
14 | * |
||
15 | * @var array |
||
16 | */ |
||
17 | protected $fillable = [ |
||
18 | 'title', |
||
19 | 'description', |
||
20 | 'is_display' |
||
21 | ]; |
||
22 | |||
23 | /** |
||
24 | * The accessors to append to the model's array form. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $appends = [ |
||
29 | 'category_url' |
||
30 | ]; |
||
31 | |||
32 | /** |
||
33 | * The "booting" method of the model. |
||
34 | * |
||
35 | * @return void |
||
36 | */ |
||
37 | protected static function boot(): void |
||
44 | }); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Return the field to slug. |
||
49 | * |
||
50 | * @return string |
||
51 | */ |
||
52 | public function slugStrategy(): string |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Get the shop items for the category. |
||
59 | * |
||
60 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
61 | */ |
||
62 | public function shopItems() |
||
67 |