Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | trait IdentifiesEloquentModels |
||
8 | { |
||
9 | /** |
||
10 | * Return whether the specified class name is an Eloquent Model. |
||
11 | * |
||
12 | * @param mixed $value |
||
13 | * |
||
14 | * @return bool |
||
15 | */ |
||
16 | protected function isModel($value): bool |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * Returns an array containing the Model class name, and the model id. |
||
23 | * The id is null if $model is a string. |
||
24 | * |
||
25 | * @param Model|string $model |
||
26 | * @param int|null $modelId (default: null) |
||
27 | * |
||
28 | * @return array |
||
29 | */ |
||
30 | protected function getModelClassNameAndId($model, ?int $modelId = null): array |
||
45 |