Total Complexity | 1 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class Dict extends Model |
||
12 | { |
||
13 | use HasFactory; |
||
14 | |||
15 | protected $table = 'lgp_dict'; |
||
16 | |||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $fillable = [ |
||
21 | 'name', |
||
22 | ]; |
||
23 | |||
24 | /** |
||
25 | * The attributes that should be hidden for arrays. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $hidden = []; |
||
30 | |||
31 | /** |
||
32 | * The attributes that should be casted to native types. |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $casts = [ |
||
37 | 'id' => 'integer', |
||
38 | 'name' => 'string', |
||
39 | ]; |
||
40 | |||
41 | /** |
||
42 | * Validation rules |
||
43 | * |
||
44 | * @var array |
||
45 | */ |
||
46 | public static $rules = [ |
||
47 | 'name' => 'required', |
||
48 | ]; |
||
49 | |||
50 | /** |
||
51 | * List option for dict |
||
52 | * |
||
53 | * @return hasMany |
||
54 | */ |
||
55 | public function options(): hasMany |
||
60 |