Total Complexity | 3 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 22.22% |
Changes | 0 |
1 | <?php |
||
24 | class Skill extends BaseModel |
||
25 | { |
||
26 | use CrudTrait; |
||
27 | use HasTranslations; |
||
28 | |||
29 | /** |
||
30 | * @var $casts string[] |
||
31 | * */ |
||
32 | protected $casts = [ |
||
33 | 'skill_type_id' => 'int' |
||
34 | ]; |
||
35 | /** |
||
36 | * @var $fillable string[] |
||
37 | * */ |
||
38 | protected $fillable = [ |
||
39 | 'name', |
||
40 | 'description', |
||
41 | 'skill_type_id' |
||
42 | ]; |
||
43 | /** |
||
44 | * @var $translatable string[] |
||
45 | * */ |
||
46 | public $translatable = [ |
||
47 | 'name', |
||
48 | 'description', |
||
49 | ]; |
||
50 | |||
51 | 4 | public function skill_type() // phpcs:ignore |
|
52 | { |
||
53 | 4 | return $this->belongsTo(\App\Models\Lookup\SkillType::class); |
|
54 | } |
||
55 | |||
56 | public function skill_declarations() // phpcs:ignore |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * Override the toArray() method to return the localized properties for |
||
63 | * name and description. This was causing issues for ajax responses. |
||
64 | * |
||
65 | * @return mixed[] |
||
66 | */ |
||
67 | public function toArray() : array |
||
73 | } |
||
74 | } |
||
75 |