| Total Complexity | 5 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class Setting extends Model |
||
| 16 | { |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var array |
||
| 20 | */ |
||
| 21 | protected $fillable = [ |
||
| 22 | 'model_type', |
||
| 23 | 'model_id', |
||
| 24 | 'key', |
||
| 25 | 'cast', |
||
| 26 | 'value', |
||
| 27 | ]; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var array |
||
| 31 | */ |
||
| 32 | protected $casts = [ |
||
| 33 | 'key' => 'string', |
||
| 34 | 'cast' => 'string', |
||
| 35 | 'value' => 'custom', |
||
| 36 | ]; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return \Illuminate\Config\Repository|mixed|string |
||
| 40 | */ |
||
| 41 | 35 | public function getTable() |
|
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return MorphTo |
||
| 52 | */ |
||
| 53 | 10 | public function model(): MorphTo |
|
| 54 | { |
||
| 55 | 10 | return $this->morphTo(); |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @param string $key |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | 35 | protected function getCastType($key): string |
|
| 69 | } |
||
| 70 | |||
| 72 |