Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 1 | public function apply(NovaRequest $request, $query, $value) |
|
21 | { |
||
22 | 1 | $selected = array_filter($value); |
|
23 | 1 | if (count($selected)) { |
|
24 | /** @var \Illuminate\Database\Eloquent\Relations\BelongsTo $relation */ |
||
25 | 1 | $relation = $query->getModel()->{$this->relationName}(); |
|
26 | |||
27 | 1 | return $query->whereIn($relation->getForeignKeyName(), array_keys($selected)); |
|
28 | } |
||
29 | |||
30 | 1 | return $query; |
|
31 | } |
||
55 |