Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVanderbist authored and github-actions[bot] committed Aug 21, 2023
1 parent 83c5c42 commit 77ada3e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/Concerns/AddsFieldsToQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Spatie\QueryBuilder\Concerns;

use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Spatie\QueryBuilder\Exceptions\AllowedFieldsMustBeCalledBeforeAllowedIncludes;
Expand Down Expand Up @@ -55,7 +54,7 @@ public function getRequestedFieldsForRelatedTable(string $relation): array
$table = Str::plural(Str::snake($relation)); // TODO: make this configurable

$fields = $this->request->fields()
->mapWithKeys(fn($fields, $table) => [$table => $fields])
->mapWithKeys(fn ($fields, $table) => [$table => $fields])
->get($table);

if (! $fields) {
Expand Down
1 change: 0 additions & 1 deletion src/QueryBuilderRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Spatie\QueryBuilder;

use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;

Expand Down
2 changes: 1 addition & 1 deletion tests/QueryBuilderRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@

it('can get requested fields without a table name', function () {
$request = new QueryBuilderRequest([
'fields' => 'name,email,related.id,related.type',
'fields' => 'name,email,related.id,related.type',
]);

$expected = collect(['_' => ['name', 'email'], 'related' => ['id', 'type']]);
Expand Down

0 comments on commit 77ada3e

Please sign in to comment.