Total Complexity | 11 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php namespace GeneaLabs\LaravelMessenger; |
||
5 | class Message extends Model |
||
6 | { |
||
7 | protected $appends = [ |
||
8 | 'autoHide', |
||
9 | 'framework', |
||
10 | 'message', |
||
11 | 'level', |
||
12 | 'title', |
||
13 | 'type', |
||
14 | ]; |
||
15 | protected $casts = [ |
||
16 | 'autoHide' => 'boolean', |
||
17 | ]; |
||
18 | protected $fillable = [ |
||
19 | 'autoHide', |
||
20 | 'framework', |
||
21 | 'message', |
||
22 | 'level', |
||
23 | 'title', |
||
24 | 'type', |
||
25 | ]; |
||
26 | |||
27 | public function getAutoHideAttribute() : bool |
||
28 | { |
||
29 | return ($this->attributes['autoHide'] === true); |
||
30 | } |
||
31 | |||
32 | public function getFrameworkAttribute() : string |
||
36 | } |
||
37 | |||
38 | public function getMessageAttribute() : string |
||
39 | { |
||
40 | return $this->attributes['message'] ?: ''; |
||
41 | } |
||
42 | |||
43 | public function getLevelAttribute() : string |
||
44 | { |
||
45 | return $this->attributes['level'] ?: 'info'; |
||
46 | } |
||
47 | |||
48 | public function getTitleAttribute() : string |
||
49 | { |
||
50 | return $this->attributes['title'] ?: ''; |
||
51 | } |
||
52 | |||
53 | public function getTypeAttribute() : string |
||
56 | } |
||
57 | } |
||
58 |