@@ -2,12 +2,12 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\QueryBuilder; |
4 | 4 | |
5 | +use Illuminate\Database\Eloquent\Builder; |
|
5 | 6 | use Illuminate\Http\Request; |
6 | 7 | use Illuminate\Support\Collection; |
7 | -use Illuminate\Database\Eloquent\Builder; |
|
8 | -use Spatie\QueryBuilder\Exceptions\InvalidSortQuery; |
|
9 | 8 | use Spatie\QueryBuilder\Exceptions\InvalidFilterQuery; |
10 | 9 | use Spatie\QueryBuilder\Exceptions\InvalidIncludeQuery; |
10 | +use Spatie\QueryBuilder\Exceptions\InvalidSortQuery; |
|
11 | 11 | |
12 | 12 | class QueryBuilder extends Builder |
13 | 13 | { |
@@ -65,6 +65,9 @@ discard block |
||
65 | 65 | $this->select(explode(',', $field)); |
66 | 66 | } |
67 | 67 | |
68 | + /** |
|
69 | + * @param string $relation |
|
70 | + */ |
|
68 | 71 | protected function getFieldsForRelation($relation) |
69 | 72 | { |
70 | 73 | $fields = $this->fields->get($relation); |
@@ -142,6 +145,9 @@ discard block |
||
142 | 145 | return $this; |
143 | 146 | } |
144 | 147 | |
148 | + /** |
|
149 | + * @param string $sorts |
|
150 | + */ |
|
145 | 151 | public function allowedSorts($sorts): self |
146 | 152 | { |
147 | 153 | $sorts = is_array($sorts) ? $sorts : func_get_args(); |