@@ -149,6 +149,9 @@ discard block |
||
| 149 | 149 | return $this; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | + /** |
|
| 153 | + * @param string $sorts |
|
| 154 | + */ |
|
| 152 | 155 | public function allowedSorts($sorts) : self |
| 153 | 156 | { |
| 154 | 157 | $sorts = is_array($sorts) ? $sorts : func_get_args(); |
@@ -350,6 +353,9 @@ discard block |
||
| 350 | 353 | } |
| 351 | 354 | } |
| 352 | 355 | |
| 356 | + /** |
|
| 357 | + * @return Collection |
|
| 358 | + */ |
|
| 353 | 359 | public function setAppendsToResult($result) |
| 354 | 360 | { |
| 355 | 361 | $result->map(function ($item) { |
@@ -2,15 +2,15 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Spatie\QueryBuilder; |
| 4 | 4 | |
| 5 | +use Illuminate\Database\Eloquent\Builder; |
|
| 6 | +use Illuminate\Database\Eloquent\Model; |
|
| 5 | 7 | use Illuminate\Http\Request; |
| 6 | 8 | use Illuminate\Support\Collection; |
| 7 | -use Illuminate\Database\Eloquent\Model; |
|
| 8 | -use Illuminate\Database\Eloquent\Builder; |
|
| 9 | -use Spatie\QueryBuilder\Exceptions\InvalidSortQuery; |
|
| 10 | -use Spatie\QueryBuilder\Exceptions\InvalidFieldQuery; |
|
| 11 | 9 | use Spatie\QueryBuilder\Exceptions\InvalidAppendQuery; |
| 10 | +use Spatie\QueryBuilder\Exceptions\InvalidFieldQuery; |
|
| 12 | 11 | use Spatie\QueryBuilder\Exceptions\InvalidFilterQuery; |
| 13 | 12 | use Spatie\QueryBuilder\Exceptions\InvalidIncludeQuery; |
| 13 | +use Spatie\QueryBuilder\Exceptions\InvalidSortQuery; |
|
| 14 | 14 | |
| 15 | 15 | class QueryBuilder extends Builder |
| 16 | 16 | { |