@@ -311,9 +311,9 @@ discard block |
||
311 | 311 | |
312 | 312 | $this->setSort(); |
313 | 313 | |
314 | - $this->queries->reject(function ($query) { |
|
314 | + $this->queries->reject(function($query) { |
|
315 | 315 | return $query['method'] == 'paginate'; |
316 | - })->each(function ($query) { |
|
316 | + })->each(function($query) { |
|
317 | 317 | $this->model = $this->model->{$query['method']}(...$query['arguments']); |
318 | 318 | }); |
319 | 319 | |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | $this->setSort(); |
365 | 365 | $this->setPaginate(); |
366 | 366 | |
367 | - $this->queries->unique()->each(function ($query) { |
|
367 | + $this->queries->unique()->each(function($query) { |
|
368 | 368 | $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']); |
369 | 369 | }); |
370 | 370 | |
@@ -394,9 +394,9 @@ discard block |
||
394 | 394 | |
395 | 395 | $queryBuilder = $this->originalModel; |
396 | 396 | |
397 | - $this->queries->reject(function ($query) { |
|
397 | + $this->queries->reject(function($query) { |
|
398 | 398 | return in_array($query['method'], ['get', 'paginate']); |
399 | - })->each(function ($query) use (&$queryBuilder) { |
|
399 | + })->each(function($query) use (&$queryBuilder) { |
|
400 | 400 | $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']); |
401 | 401 | }); |
402 | 402 | |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | { |
431 | 431 | $paginate = $this->findQueryByMethod('paginate'); |
432 | 432 | |
433 | - $this->queries = $this->queries->reject(function ($query) { |
|
433 | + $this->queries = $this->queries->reject(function($query) { |
|
434 | 434 | return $query['method'] == 'paginate'; |
435 | 435 | }); |
436 | 436 | |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | */ |
489 | 489 | protected function findQueryByMethod($method) |
490 | 490 | { |
491 | - return $this->queries->first(function ($query) use ($method) { |
|
491 | + return $this->queries->first(function($query) use ($method) { |
|
492 | 492 | return $query['method'] == $method; |
493 | 493 | }); |
494 | 494 | } |
@@ -515,11 +515,11 @@ discard block |
||
515 | 515 | $this->resetOrderBy(); |
516 | 516 | |
517 | 517 | // get column. if contains "cast", set set column as cast |
518 | - if(!empty($this->sort['cast'])){ |
|
518 | + if (!empty($this->sort['cast'])) { |
|
519 | 519 | $column = "CAST({$this->sort['column']} AS {$this->sort['cast']}) {$this->sort['type']}"; |
520 | 520 | $method = 'orderByRaw'; |
521 | 521 | $arguments = [$column]; |
522 | - }else{ |
|
522 | + } else { |
|
523 | 523 | $column = $this->sort['column']; |
524 | 524 | $method = 'orderBy'; |
525 | 525 | $arguments = [$column, $this->sort['type']]; |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | { |
544 | 544 | list($relationName, $relationColumn) = explode('.', $column); |
545 | 545 | |
546 | - if ($this->queries->contains(function ($query) use ($relationName) { |
|
546 | + if ($this->queries->contains(function($query) use ($relationName) { |
|
547 | 547 | return $query['method'] == 'with' && in_array($relationName, $query['arguments']); |
548 | 548 | })) { |
549 | 549 | $relation = $this->model->$relationName(); |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | */ |
578 | 578 | public function resetOrderBy() |
579 | 579 | { |
580 | - $this->queries = $this->queries->reject(function ($query) { |
|
580 | + $this->queries = $this->queries->reject(function($query) { |
|
581 | 581 | return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc'; |
582 | 582 | }); |
583 | 583 | } |
@@ -519,7 +519,7 @@ |
||
519 | 519 | $column = "CAST({$this->sort['column']} AS {$this->sort['cast']}) {$this->sort['type']}"; |
520 | 520 | $method = 'orderByRaw'; |
521 | 521 | $arguments = [$column]; |
522 | - }else{ |
|
522 | + } else{ |
|
523 | 523 | $column = $this->sort['column']; |
524 | 524 | $method = 'orderBy'; |
525 | 525 | $arguments = [$column, $this->sort['type']]; |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | |
347 | 347 | $column = $this; |
348 | 348 | |
349 | - return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) { |
|
349 | + return $this->display(function($value) use ($grid, $column, $abstract, $arguments) { |
|
350 | 350 | /** @var AbstractDisplayer $displayer */ |
351 | 351 | $displayer = new $abstract($value, $grid, $column, $this); |
352 | 352 | |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | */ |
365 | 365 | public function using(array $values, $default = null) |
366 | 366 | { |
367 | - return $this->display(function ($value) use ($values, $default) { |
|
367 | + return $this->display(function($value) use ($values, $default) { |
|
368 | 368 | if (is_null($value)) { |
369 | 369 | return $default; |
370 | 370 | } |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | */ |
383 | 383 | public function view($view) |
384 | 384 | { |
385 | - return $this->display(function ($value) use ($view) { |
|
385 | + return $this->display(function($value) use ($view) { |
|
386 | 386 | $model = $this; |
387 | 387 | |
388 | 388 | return view($view, compact('model', 'value'))->render(); |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | $grid = $this->grid; |
506 | 506 | $column = $this; |
507 | 507 | |
508 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
508 | + $this->display(function($value) use ($grid, $column, $class) { |
|
509 | 509 | /** @var AbstractDisplayer $definition */ |
510 | 510 | $definition = new $class($value, $grid, $column, $this); |
511 | 511 | |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | protected function htmlEntityEncode($item) |
524 | 524 | { |
525 | 525 | if (is_array($item)) { |
526 | - array_walk_recursive($item, function (&$value) { |
|
526 | + array_walk_recursive($item, function(&$value) { |
|
527 | 527 | $value = htmlentities($value); |
528 | 528 | }); |
529 | 529 | } else { |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | |
555 | 555 | // set sort value |
556 | 556 | $sort = ['column' => $this->name, 'type' => $type]; |
557 | - if(isset($this->cast)){ |
|
557 | + if (isset($this->cast)) { |
|
558 | 558 | $sort['cast'] = $this->cast; |
559 | 559 | } |
560 | 560 | |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | */ |
610 | 610 | protected function callSupportDisplayer($abstract, $arguments) |
611 | 611 | { |
612 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
612 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
613 | 613 | if (is_array($value) || $value instanceof Arrayable) { |
614 | 614 | return call_user_func_array([collect($value), $abstract], $arguments); |
615 | 615 | } |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | protected function callBuiltinDisplayer($abstract, $arguments) |
634 | 634 | { |
635 | 635 | if ($abstract instanceof Closure) { |
636 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
636 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
637 | 637 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
638 | 638 | }); |
639 | 639 | } |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | $grid = $this->grid; |
643 | 643 | $column = $this; |
644 | 644 | |
645 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
645 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
646 | 646 | /** @var AbstractDisplayer $displayer */ |
647 | 647 | $displayer = new $abstract($value, $grid, $column, $this); |
648 | 648 |