Total Complexity | 2 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | #[ObservedBy([BlogCategoryObserver::class])] |
||
14 | class BlogCategory extends Model |
||
15 | { |
||
16 | use BlogCategoryPresenter; |
||
|
|||
17 | use HasSlugs; |
||
18 | |||
19 | /** |
||
20 | * The attributes that are mass assignable. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $fillable = [ |
||
25 | 'title', |
||
26 | 'slug', |
||
27 | 'description' |
||
28 | ]; |
||
29 | |||
30 | /** |
||
31 | * The accessors to append to the model's array form. |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $appends = [ |
||
36 | 'show_url' |
||
37 | ]; |
||
38 | |||
39 | /** |
||
40 | * Return the field to slug. |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | public function slugStrategy(): string |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * Get the articles for the category. |
||
51 | * |
||
52 | * @return HasMany |
||
53 | */ |
||
54 | public function articles(): HasMany |
||
59 |