Total Complexity | 6 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class CharacteristicsModel extends Model |
||
15 | { |
||
16 | use HasFactory; |
||
17 | |||
18 | protected $table = 'characteristics'; |
||
19 | |||
20 | protected $fillable = [ |
||
21 | 'uuid', |
||
22 | 'main', |
||
23 | 'priority', |
||
24 | 'icon', |
||
25 | 'page_label', |
||
26 | 'pretty_page_label', |
||
27 | 'page_id', |
||
28 | 'type', |
||
29 | 'code', |
||
30 | 'visible', |
||
31 | ]; |
||
32 | |||
33 | protected $casts = [ |
||
34 | 'opt' => 'array' |
||
35 | ]; |
||
36 | |||
37 | public function users() |
||
41 | } |
||
42 | |||
43 | public function toDto() |
||
56 | ); |
||
57 | } |
||
58 | |||
59 | public function picturePath():string |
||
60 | { |
||
61 | return storage_path('app/public/characteristics/' . $this->uuid . '.png'); |
||
62 | } |
||
63 | |||
64 | public function toDomain() |
||
65 | { |
||
66 | return new Characteristic($this->uuid, $this->type, $this->code, $this->attributes['visible']); |
||
67 | } |
||
68 | |||
69 | protected static function newFactory() |
||
72 | } |
||
73 | } |
||
74 |