| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function apply(Builder $builder, Model $model) |
||
| 20 | { |
||
| 21 | $include = $this->hasArray($this->request->get(config('queryScope.include.param', 'include'), null)); |
||
| 22 | $existing = array_filter($include, function ($includeName) use ($model) { |
||
| 23 | return method_exists($model, $includeName); |
||
| 24 | }); |
||
| 25 | |||
| 26 | if (count($existing) > 0) { |
||
| 27 | $builder = $builder->with($existing); |
||
| 28 | } |
||
| 29 | |||
| 30 | return $builder; |
||
| 31 | } |
||
| 32 | } |
||
| 33 |