Total Complexity | 1 |
Total Lines | 70 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | class Theme extends Model |
||
9 | { |
||
10 | use SoftDeletes; |
||
11 | |||
12 | /** |
||
13 | * The database table used by the model. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $table = 'themes'; |
||
18 | |||
19 | /** |
||
20 | * The attributes that are not mass assignable. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $guarded = [ |
||
25 | 'id', |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * Fillable fields for a Profile. |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $fillable = [ |
||
34 | 'name', |
||
35 | 'link', |
||
36 | 'notes', |
||
37 | 'status', |
||
38 | 'taggable_id', |
||
39 | 'taggable_type', |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * Typecasting is awesome. |
||
44 | * |
||
45 | * @var array |
||
46 | */ |
||
47 | protected $casts = [ |
||
48 | 'id' => 'integer', |
||
49 | 'name' => 'string', |
||
50 | 'link' => 'string', |
||
51 | 'notes' => 'string', |
||
52 | 'status' => 'boolean', |
||
53 | 'taggable_id' => 'integer', |
||
54 | 'taggable_type' => 'string', |
||
55 | ]; |
||
56 | |||
57 | /** |
||
58 | * The attributes that should be mutated to dates. |
||
59 | * |
||
60 | * @var array |
||
61 | */ |
||
62 | protected $dates = [ |
||
63 | 'created_at', |
||
64 | 'updated_at', |
||
65 | 'deleted_at', |
||
66 | ]; |
||
67 | |||
68 | /** |
||
69 | * Scope a query to get enabled themes. |
||
70 | * |
||
71 | * @param \Illuminate\Database\Eloquent\Builder $query |
||
72 | * |
||
73 | * @return \Illuminate\Database\Eloquent\Builder |
||
74 | */ |
||
75 | public function scopeEnabledThemes($query) |
||
80 |