zingimmick /
laravel-query-builder
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace Zing\QueryBuilder\Sorts; |
||
| 6 | |||
| 7 | use Illuminate\Database\Eloquent\Builder; |
||
| 8 | use Zing\QueryBuilder\Contracts\Sort; |
||
| 9 | |||
| 10 | class SortField implements Sort |
||
| 11 | { |
||
| 12 | 3 | public function apply(Builder $query, bool $descending, string $property): Builder |
|
| 13 | { |
||
| 14 | 3 | return $query->orderBy($property, $descending ? 'desc' : 'asc'); |
|
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 15 | } |
||
| 16 | } |
||
| 17 |