@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function getArgs(): array |
130 | 130 | { |
131 | - return collect($this->args())->map(function (RootType $type) { |
|
131 | + return collect($this->args())->map(function(RootType $type) { |
|
132 | 132 | return $type->toType(); |
133 | 133 | })->toArray(); |
134 | 134 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | private function getResolver() |
182 | 182 | { |
183 | - if (! method_exists($this, 'resolve')) { |
|
183 | + if (!method_exists($this, 'resolve')) { |
|
184 | 184 | return null; |
185 | 185 | } |
186 | 186 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function abstractResolver($root, array $args, $context, ResolveInfo $info) |
198 | 198 | { |
199 | - if (! method_exists($this, 'resolve')) { |
|
199 | + if (!method_exists($this, 'resolve')) { |
|
200 | 200 | return null; |
201 | 201 | } |
202 | 202 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | try { |
219 | 219 | $result = $this->authorize($args); |
220 | 220 | |
221 | - if (! $result instanceof Response) { |
|
221 | + if (!$result instanceof Response) { |
|
222 | 222 | $result = $result ? Response::allow() : Response::deny(); |
223 | 223 | } |
224 | 224 | } catch (AuthorizationException $exception) { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | // We wrap the query in a closure to make sure it |
31 | 31 | // does not clash with other (scoped) queries that are on the builder. |
32 | - return $query->where(function ($query) use ($args) { |
|
32 | + return $query->where(function($query) use ($args) { |
|
33 | 33 | return $this->applyFiltersRecursively($query, $args); |
34 | 34 | }); |
35 | 35 | } |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | { |
47 | 47 | foreach ($args as $filter => $value) { |
48 | 48 | if ($filter === 'AND' || $filter === 'OR') { |
49 | - $query->where(function ($query) use ($value, $filter) { |
|
49 | + $query->where(function($query) use ($value, $filter) { |
|
50 | 50 | foreach ($value as $set) { |
51 | - if (! empty($set)) { |
|
51 | + if (!empty($set)) { |
|
52 | 52 | $this->applyFiltersRecursively($query, $set, $filter); |
53 | 53 | } |
54 | 54 | } |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | $operator = '>='; |
87 | 87 | $type = $type ?: 'and'; |
88 | 88 | |
89 | - if (! $args || $args->isEmpty()) { |
|
89 | + if (!$args || $args->isEmpty()) { |
|
90 | 90 | return $query->doesntHave($relation, $type); |
91 | 91 | } |
92 | 92 | |
93 | - return $query->has($relation, $operator, $count, $type, function ($subQuery) use ($args) { |
|
93 | + return $query->has($relation, $operator, $count, $type, function($subQuery) use ($args) { |
|
94 | 94 | return $this->applyFiltersRecursively($subQuery, $args); |
95 | 95 | }); |
96 | 96 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | */ |
35 | 35 | public function executeQuery($input, $schema = null): ExecutionResult |
36 | 36 | { |
37 | - if (! $schema) { |
|
37 | + if (!$schema) { |
|
38 | 38 | $schema = $this->schema(); |
39 | 39 | } elseif ($schema instanceof BakerySchema) { |
40 | 40 | $schema = $schema->toGraphQLSchema(); |
@@ -60,7 +60,7 @@ |
||
60 | 60 | */ |
61 | 61 | public function graphiql(Request $request, Bakery $bakery) |
62 | 62 | { |
63 | - if (! app()->isLocal()) { |
|
63 | + if (!app()->isLocal()) { |
|
64 | 64 | abort(404); |
65 | 65 | } |
66 | 66 |
@@ -7,7 +7,7 @@ |
||
7 | 7 | ->middleware(config('bakery.middleware', [])) |
8 | 8 | ->as('bakery.') |
9 | 9 | ->prefix(config('bakery.path')) |
10 | - ->group(function () { |
|
10 | + ->group(function() { |
|
11 | 11 | $controller = config('bakery.controller', 'BakeryController@graphql'); |
12 | 12 | |
13 | 13 | Route::get('/', $controller)->name('graphql'); |
@@ -92,7 +92,7 @@ |
||
92 | 92 | { |
93 | 93 | foreach ($args as $key => $value) { |
94 | 94 | if ($value instanceof Arguments) { |
95 | - $query->whereHas($key, function (Builder $query) use ($value) { |
|
95 | + $query->whereHas($key, function(Builder $query) use ($value) { |
|
96 | 96 | $this->queryByArgs($query, $value); |
97 | 97 | }); |
98 | 98 | } else { |
@@ -66,7 +66,7 @@ |
||
66 | 66 | $args->put('search', $this->registry->type($this->modelSchema->typename().'RootSearch')->nullable()); |
67 | 67 | } |
68 | 68 | |
69 | - if (! empty($this->modelSchema->getFields())) { |
|
69 | + if (!empty($this->modelSchema->getFields())) { |
|
70 | 70 | $args->put('orderBy', $this->registry->type($this->modelSchema->typename().'OrderBy')->nullable()); |
71 | 71 | } |
72 | 72 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | */ |
54 | 54 | public function getModelSchemaByKey(string $key) |
55 | 55 | { |
56 | - return collect($this->modelSchemas)->first(function ($definition) use ($key) { |
|
56 | + return collect($this->modelSchemas)->first(function($definition) use ($key) { |
|
57 | 57 | return Utils::single(resolve($definition)->getModel()) === $key; |
58 | 58 | }); |
59 | 59 | } |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | $args = new Arguments($args); |
515 | 515 | |
516 | 516 | if (isset($this->viewPolicy)) { |
517 | - if (! $this->authorizeToRead($root, $info->fieldName)) { |
|
517 | + if (!$this->authorizeToRead($root, $info->fieldName)) { |
|
518 | 518 | return null; |
519 | 519 | } |
520 | 520 | } |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | $policy = $this->viewPolicy; |
556 | 556 | |
557 | 557 | // Check if there is a policy. |
558 | - if (! $policy) { |
|
558 | + if (!$policy) { |
|
559 | 559 | return true; |
560 | 560 | } |
561 | 561 | |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | $policy = $this->storePolicy; |
607 | 607 | |
608 | 608 | // Check if there is a policy. |
609 | - if (! $policy) { |
|
609 | + if (!$policy) { |
|
610 | 610 | return true; |
611 | 611 | } |
612 | 612 | |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | { |
633 | 633 | return [ |
634 | 634 | 'type' => $this->getType()->toType(), |
635 | - 'args' => collect($this->getArgs())->map(function (RootType $type) { |
|
635 | + 'args' => collect($this->getArgs())->map(function(RootType $type) { |
|
636 | 636 | return $type->toType(); |
637 | 637 | })->toArray(), |
638 | 638 | 'resolve' => [$this, 'resolveField'], |