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