Total Complexity | 5 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | trait HasSchemalessTable |
||
9 | { |
||
10 | public static function bootHasSchemalessTable() |
||
11 | { |
||
12 | static::saving(function (Model &$model) { |
||
13 | $model->model = $model->model ?: get_class($model); |
||
14 | $model->locale = $model->locale ?: app()->getLocale(); |
||
|
|||
15 | }); |
||
16 | |||
17 | // limit query of this model to its type |
||
18 | static::addGlobalScope(new DocumentScope()); |
||
19 | } |
||
20 | |||
21 | public function getTable() |
||
24 | } |
||
25 | |||
26 | public function getFillable() |
||
34 | ] |
||
35 | ); |
||
38 |