@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\QueryBuilder\Filters; |
4 | 4 | |
5 | -use Illuminate\Support\Str; |
|
6 | -use Illuminate\Support\Collection; |
|
7 | 5 | use Illuminate\Database\Eloquent\Builder; |
6 | +use Illuminate\Support\Collection; |
|
7 | +use Illuminate\Support\Str; |
|
8 | 8 | |
9 | 9 | class FiltersExact implements Filter |
10 | 10 | { |
@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\QueryBuilder; |
4 | 4 | |
5 | -use Illuminate\Support\Str; |
|
6 | 5 | use Illuminate\Http\Request; |
7 | 6 | use Illuminate\Support\Collection; |
7 | +use Illuminate\Support\Str; |
|
8 | 8 | |
9 | 9 | class QueryBuilderRequest extends Request |
10 | 10 | { |
@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\QueryBuilder; |
4 | 4 | |
5 | -use Illuminate\Http\Request; |
|
6 | 5 | use Illuminate\Database\Eloquent\Builder; |
7 | -use Spatie\QueryBuilder\Concerns\SortsQuery; |
|
8 | -use Spatie\QueryBuilder\Concerns\FiltersQuery; |
|
6 | +use Illuminate\Http\Request; |
|
9 | 7 | use Spatie\QueryBuilder\Concerns\AddsFieldsToQuery; |
10 | 8 | use Spatie\QueryBuilder\Concerns\AddsIncludesToQuery; |
11 | 9 | use Spatie\QueryBuilder\Concerns\AppendsAttributesToResults; |
10 | +use Spatie\QueryBuilder\Concerns\FiltersQuery; |
|
11 | +use Spatie\QueryBuilder\Concerns\SortsQuery; |
|
12 | 12 | |
13 | 13 | class QueryBuilder extends Builder |
14 | 14 | { |
@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\QueryBuilder; |
4 | 4 | |
5 | +use Spatie\QueryBuilder\Enums\SortDirection; |
|
5 | 6 | use Spatie\QueryBuilder\Sorts\Sort; |
6 | 7 | use Spatie\QueryBuilder\Sorts\SortsField; |
7 | -use Spatie\QueryBuilder\Enums\SortDirection; |
|
8 | 8 | |
9 | 9 | class AllowedSort |
10 | 10 | { |
@@ -92,6 +92,9 @@ |
||
92 | 92 | }, $fields); |
93 | 93 | } |
94 | 94 | |
95 | + /** |
|
96 | + * @param string $table |
|
97 | + */ |
|
95 | 98 | protected function prependField(string $field, ?string $table = null): string |
96 | 99 | { |
97 | 100 | if (! $table) { |
@@ -2,11 +2,11 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\QueryBuilder\Concerns; |
4 | 4 | |
5 | -use Illuminate\Support\Str; |
|
6 | 5 | use Illuminate\Support\Collection; |
6 | +use Illuminate\Support\Str; |
|
7 | +use Spatie\QueryBuilder\Exceptions\AllowedFieldsMustBeCalledBeforeAllowedIncludes; |
|
7 | 8 | use Spatie\QueryBuilder\Exceptions\InvalidFieldQuery; |
8 | 9 | use Spatie\QueryBuilder\Exceptions\UnknownIncludedFieldsQuery; |
9 | -use Spatie\QueryBuilder\Exceptions\AllowedFieldsMustBeCalledBeforeAllowedIncludes; |
|
10 | 10 | |
11 | 11 | trait AddsFieldsToQuery |
12 | 12 | { |
@@ -2,11 +2,11 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\QueryBuilder\Concerns; |
4 | 4 | |
5 | -use Illuminate\Support\Str; |
|
6 | 5 | use Illuminate\Support\Collection; |
6 | +use Illuminate\Support\Str; |
|
7 | 7 | use Spatie\QueryBuilder\AllowedInclude; |
8 | -use Spatie\QueryBuilder\Includes\IncludeInterface; |
|
9 | 8 | use Spatie\QueryBuilder\Exceptions\InvalidIncludeQuery; |
9 | +use Spatie\QueryBuilder\Includes\IncludeInterface; |
|
10 | 10 | |
11 | 11 | trait AddsIncludesToQuery |
12 | 12 | { |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\QueryBuilder\Concerns; |
4 | 4 | |
5 | -use Illuminate\Support\Collection; |
|
6 | 5 | use Illuminate\Database\Eloquent\Model; |
6 | +use Illuminate\Support\Collection; |
|
7 | 7 | use Spatie\QueryBuilder\Exceptions\InvalidAppendQuery; |
8 | 8 | |
9 | 9 | trait AppendsAttributesToResults |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * @param array|string|\Spatie\QueryBuilder\AllowedSort $sorts |
40 | 40 | * |
41 | - * @return \Spatie\QueryBuilder\QueryBuilder |
|
41 | + * @return SortsQuery |
|
42 | 42 | */ |
43 | 43 | public function defaultSort($sorts): self |
44 | 44 | { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * @param array|string|\Spatie\QueryBuilder\AllowedSort $sorts |
50 | 50 | * |
51 | - * @return \Spatie\QueryBuilder\QueryBuilder |
|
51 | + * @return SortsQuery |
|
52 | 52 | */ |
53 | 53 | public function defaultSorts($sorts): self |
54 | 54 | { |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\QueryBuilder\Includes; |
4 | 4 | |
5 | -use Illuminate\Support\Collection; |
|
6 | 5 | use Illuminate\Database\Eloquent\Builder; |
6 | +use Illuminate\Support\Collection; |
|
7 | 7 | |
8 | 8 | class IncludedRelationship implements IncludeInterface |
9 | 9 | { |