@@ -331,9 +331,9 @@ discard block |
||
| 331 | 331 | |
| 332 | 332 | $this->setSort(); |
| 333 | 333 | |
| 334 | - $this->queries->reject(function ($query) { |
|
| 334 | + $this->queries->reject(function($query) { |
|
| 335 | 335 | return $query['method'] == 'paginate'; |
| 336 | - })->each(function ($query) { |
|
| 336 | + })->each(function($query) { |
|
| 337 | 337 | $this->model = $this->model->{$query['method']}(...$query['arguments']); |
| 338 | 338 | }); |
| 339 | 339 | |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $this->setSort(); |
| 385 | 385 | $this->setPaginate(); |
| 386 | 386 | |
| 387 | - $this->queries->unique()->each(function ($query) { |
|
| 387 | + $this->queries->unique()->each(function($query) { |
|
| 388 | 388 | if ($query['method'] == 'with') { |
| 389 | 389 | $this->model = $this->model->with($query['arguments']); |
| 390 | 390 | } else { |
@@ -418,9 +418,9 @@ discard block |
||
| 418 | 418 | |
| 419 | 419 | $queryBuilder = $this->originalModel; |
| 420 | 420 | |
| 421 | - $this->queries->reject(function ($query) { |
|
| 421 | + $this->queries->reject(function($query) { |
|
| 422 | 422 | return in_array($query['method'], ['get', 'paginate']); |
| 423 | - })->each(function ($query) use (&$queryBuilder) { |
|
| 423 | + })->each(function($query) use (&$queryBuilder) { |
|
| 424 | 424 | $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']); |
| 425 | 425 | }); |
| 426 | 426 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | { |
| 455 | 455 | $paginate = $this->findQueryByMethod('paginate'); |
| 456 | 456 | |
| 457 | - $this->queries = $this->queries->reject(function ($query) { |
|
| 457 | + $this->queries = $this->queries->reject(function($query) { |
|
| 458 | 458 | return $query['method'] == 'paginate'; |
| 459 | 459 | }); |
| 460 | 460 | |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | */ |
| 513 | 513 | protected function findQueryByMethod($method) |
| 514 | 514 | { |
| 515 | - return $this->queries->first(function ($query) use ($method) { |
|
| 515 | + return $this->queries->first(function($query) use ($method) { |
|
| 516 | 516 | return $query['method'] == $method; |
| 517 | 517 | }); |
| 518 | 518 | } |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | $columnNameContainsDots = Str::contains($columnName, '.'); |
| 538 | - $isRelation = $this->queries->contains(function ($query) use ($columnName) { |
|
| 538 | + $isRelation = $this->queries->contains(function($query) use ($columnName) { |
|
| 539 | 539 | return $query['method'] === 'with' && in_array($columnName, $query['arguments'], true); |
| 540 | 540 | }); |
| 541 | 541 | if ($columnNameContainsDots === true && $isRelation) { |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | { |
| 582 | 582 | list($relationName, $relationColumn) = explode('.', $column); |
| 583 | 583 | |
| 584 | - if ($this->queries->contains(function ($query) use ($relationName) { |
|
| 584 | + if ($this->queries->contains(function($query) use ($relationName) { |
|
| 585 | 585 | return $query['method'] == 'with' && in_array($relationName, $query['arguments']); |
| 586 | 586 | })) { |
| 587 | 587 | $relation = $this->model->$relationName(); |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | */ |
| 616 | 616 | public function resetOrderBy() |
| 617 | 617 | { |
| 618 | - $this->queries = $this->queries->reject(function ($query) { |
|
| 618 | + $this->queries = $this->queries->reject(function($query) { |
|
| 619 | 619 | return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc'; |
| 620 | 620 | }); |
| 621 | 621 | } |