| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | 11 | public function apply(Builder $builder, Model $model) |
|
| 39 | { |
||
| 40 | 11 | $start = $this->start; |
|
| 41 | 11 | $end = $this->end; |
|
| 42 | $builder |
||
| 43 | ->when(! is_null($start), function ($query) use ($start, $model) { |
||
| 44 | 7 | return $query->where($model->getKeyName(), '>', $start); |
|
| 45 | 11 | }) |
|
| 46 | ->when(! is_null($end), function ($query) use ($end, $model) { |
||
| 47 | 9 | return $query->where($model->getKeyName(), '<=', $end); |
|
| 48 | 11 | }); |
|
| 56 |