@@ -325,9 +325,9 @@ discard block |
||
| 325 | 325 | |
| 326 | 326 | $this->setSort(); |
| 327 | 327 | |
| 328 | - $this->queries->reject(function ($query) { |
|
| 328 | + $this->queries->reject(function($query) { |
|
| 329 | 329 | return $query['method'] == 'paginate'; |
| 330 | - })->each(function ($query) { |
|
| 330 | + })->each(function($query) { |
|
| 331 | 331 | $this->model = $this->model->{$query['method']}(...$query['arguments']); |
| 332 | 332 | }); |
| 333 | 333 | |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | $this->setSort(); |
| 379 | 379 | $this->setPaginate(); |
| 380 | 380 | |
| 381 | - $this->queries->unique()->each(function ($query) { |
|
| 381 | + $this->queries->unique()->each(function($query) { |
|
| 382 | 382 | $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']); |
| 383 | 383 | }); |
| 384 | 384 | |
@@ -408,9 +408,9 @@ discard block |
||
| 408 | 408 | |
| 409 | 409 | $queryBuilder = $this->originalModel; |
| 410 | 410 | |
| 411 | - $this->queries->reject(function ($query) { |
|
| 411 | + $this->queries->reject(function($query) { |
|
| 412 | 412 | return in_array($query['method'], ['get', 'paginate']); |
| 413 | - })->each(function ($query) use (&$queryBuilder) { |
|
| 413 | + })->each(function($query) use (&$queryBuilder) { |
|
| 414 | 414 | $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']); |
| 415 | 415 | }); |
| 416 | 416 | |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | { |
| 445 | 445 | $paginate = $this->findQueryByMethod('paginate'); |
| 446 | 446 | |
| 447 | - $this->queries = $this->queries->reject(function ($query) { |
|
| 447 | + $this->queries = $this->queries->reject(function($query) { |
|
| 448 | 448 | return $query['method'] == 'paginate'; |
| 449 | 449 | }); |
| 450 | 450 | |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | */ |
| 503 | 503 | protected function findQueryByMethod($method) |
| 504 | 504 | { |
| 505 | - return $this->queries->first(function ($query) use ($method) { |
|
| 505 | + return $this->queries->first(function($query) use ($method) { |
|
| 506 | 506 | return $query['method'] == $method; |
| 507 | 507 | }); |
| 508 | 508 | } |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | $columnNameContainsDots = Str::contains($columnName, '.'); |
| 528 | - $isRelation = $this->queries->contains(function ($query) use ($columnName) { |
|
| 528 | + $isRelation = $this->queries->contains(function($query) use ($columnName) { |
|
| 529 | 529 | // relationship should be camel case |
| 530 | 530 | $columnName = Str::camel(Str::before($columnName, '.')); |
| 531 | 531 | |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | // relationship should be camel case |
| 577 | 577 | $relationName = Str::camel($relationName); |
| 578 | 578 | |
| 579 | - if ($this->queries->contains(function ($query) use ($relationName) { |
|
| 579 | + if ($this->queries->contains(function($query) use ($relationName) { |
|
| 580 | 580 | return $query['method'] == 'with' && in_array($relationName, $query['arguments']); |
| 581 | 581 | })) { |
| 582 | 582 | $relation = $this->model->$relationName(); |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | */ |
| 611 | 611 | public function resetOrderBy() |
| 612 | 612 | { |
| 613 | - $this->queries = $this->queries->reject(function ($query) { |
|
| 613 | + $this->queries = $this->queries->reject(function($query) { |
|
| 614 | 614 | return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc'; |
| 615 | 615 | }); |
| 616 | 616 | } |