| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 47 | public function apply(Builder $builder, Model $model) |
||
| 48 | { |
||
| 49 | // Use '-' prefix to order NULL values last |
||
| 50 | if ($this->raw) { |
||
| 51 | $builder->orderByRaw("-`{$this->column}` desc"); |
||
| 52 | $builder->orderBy($this->column, $this->direction); |
||
| 53 | } |
||
| 54 | |||
| 55 | // Standard orderBy clause |
||
| 56 | else { |
||
| 57 | $builder->orderBy($this->column, $this->direction); |
||
| 58 | } |
||
| 61 |