@@ -347,9 +347,9 @@ discard block |
||
347 | 347 | |
348 | 348 | $this->setSort(); |
349 | 349 | |
350 | - $this->queries->reject(function ($query) { |
|
350 | + $this->queries->reject(function($query) { |
|
351 | 351 | return $query['method'] == 'paginate'; |
352 | - })->each(function ($query) { |
|
352 | + })->each(function($query) { |
|
353 | 353 | $this->model = $this->model->{$query['method']}(...$query['arguments']); |
354 | 354 | }); |
355 | 355 | |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | $this->setSort(); |
401 | 401 | $this->setPaginate(); |
402 | 402 | |
403 | - $this->queries->unique()->each(function ($query) { |
|
403 | + $this->queries->unique()->each(function($query) { |
|
404 | 404 | $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']); |
405 | 405 | }); |
406 | 406 | |
@@ -430,9 +430,9 @@ discard block |
||
430 | 430 | |
431 | 431 | $queryBuilder = $this->originalModel; |
432 | 432 | |
433 | - $this->queries->reject(function ($query) { |
|
433 | + $this->queries->reject(function($query) { |
|
434 | 434 | return in_array($query['method'], ['get', 'paginate']); |
435 | - })->each(function ($query) use (&$queryBuilder) { |
|
435 | + })->each(function($query) use (&$queryBuilder) { |
|
436 | 436 | $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']); |
437 | 437 | }); |
438 | 438 | |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | { |
467 | 467 | $paginate = $this->findQueryByMethod('paginate'); |
468 | 468 | |
469 | - $this->queries = $this->queries->reject(function ($query) { |
|
469 | + $this->queries = $this->queries->reject(function($query) { |
|
470 | 470 | return $query['method'] == 'paginate'; |
471 | 471 | }); |
472 | 472 | |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | */ |
525 | 525 | protected function findQueryByMethod($method) |
526 | 526 | { |
527 | - return $this->queries->first(function ($query) use ($method) { |
|
527 | + return $this->queries->first(function($query) use ($method) { |
|
528 | 528 | return $query['method'] == $method; |
529 | 529 | }); |
530 | 530 | } |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | { |
580 | 580 | list($relationName, $relationColumn) = explode('.', $column); |
581 | 581 | |
582 | - if ($this->queries->contains(function ($query) use ($relationName) { |
|
582 | + if ($this->queries->contains(function($query) use ($relationName) { |
|
583 | 583 | return $query['method'] == 'with' && in_array($relationName, $query['arguments']); |
584 | 584 | })) { |
585 | 585 | $relation = $this->model->$relationName(); |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | */ |
614 | 614 | public function resetOrderBy() |
615 | 615 | { |
616 | - $this->queries = $this->queries->reject(function ($query) { |
|
616 | + $this->queries = $this->queries->reject(function($query) { |
|
617 | 617 | return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc'; |
618 | 618 | }); |
619 | 619 | } |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | $name = $this->getName(); |
489 | 489 | $query = request()->query(); |
490 | 490 | |
491 | - $this->prefix(function ($_, $original) use ($name, $query) { |
|
491 | + $this->prefix(function($_, $original) use ($name, $query) { |
|
492 | 492 | Arr::set($query, $name, $original); |
493 | 493 | |
494 | 494 | $url = request()->fullUrlWithQuery($query); |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | |
542 | 542 | $column = $this; |
543 | 543 | |
544 | - return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) { |
|
544 | + return $this->display(function($value) use ($grid, $column, $abstract, $arguments) { |
|
545 | 545 | /** @var AbstractDisplayer $displayer */ |
546 | 546 | $displayer = new $abstract($value, $grid, $column, $this); |
547 | 547 | |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | */ |
560 | 560 | public function using(array $values, $default = null) |
561 | 561 | { |
562 | - return $this->display(function ($value) use ($values, $default) { |
|
562 | + return $this->display(function($value) use ($values, $default) { |
|
563 | 563 | if (is_null($value)) { |
564 | 564 | return $default; |
565 | 565 | } |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | */ |
578 | 578 | public function replace(array $replacements) |
579 | 579 | { |
580 | - return $this->display(function ($value) use ($replacements) { |
|
580 | + return $this->display(function($value) use ($replacements) { |
|
581 | 581 | if (isset($replacements[$value])) { |
582 | 582 | return $replacements[$value]; |
583 | 583 | } |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | */ |
596 | 596 | public function view($view) |
597 | 597 | { |
598 | - return $this->display(function ($value) use ($view) { |
|
598 | + return $this->display(function($value) use ($view) { |
|
599 | 599 | $model = $this; |
600 | 600 | |
601 | 601 | return view($view, compact('model', 'value'))->render(); |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | */ |
636 | 636 | public function filesize() |
637 | 637 | { |
638 | - return $this->display(function ($value) { |
|
638 | + return $this->display(function($value) { |
|
639 | 639 | return file_size($value); |
640 | 640 | }); |
641 | 641 | } |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | */ |
650 | 650 | public function gravatar($size = 30) |
651 | 651 | { |
652 | - return $this->display(function ($value) use ($size) { |
|
652 | + return $this->display(function($value) use ($size) { |
|
653 | 653 | $src = sprintf( |
654 | 654 | 'https://www.gravatar.com/avatar/%s?s=%d', |
655 | 655 | md5(strtolower($value)), |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | */ |
671 | 671 | public function loading($values = [], $others = []) |
672 | 672 | { |
673 | - return $this->display(function ($value) use ($values, $others) { |
|
673 | + return $this->display(function($value) use ($values, $others) { |
|
674 | 674 | $values = (array) $values; |
675 | 675 | |
676 | 676 | if (in_array($value, $values)) { |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | */ |
692 | 692 | public function icon(array $setting, $default = '') |
693 | 693 | { |
694 | - return $this->display(function ($value) use ($setting, $default) { |
|
694 | + return $this->display(function($value) use ($setting, $default) { |
|
695 | 695 | $fa = ''; |
696 | 696 | |
697 | 697 | if (isset($setting[$value])) { |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | Carbon::setLocale($locale); |
718 | 718 | } |
719 | 719 | |
720 | - return $this->display(function ($value) { |
|
720 | + return $this->display(function($value) { |
|
721 | 721 | return Carbon::parse($value)->diffForHumans(); |
722 | 722 | }); |
723 | 723 | } |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | */ |
732 | 732 | public function date($format) |
733 | 733 | { |
734 | - return $this->display(function ($value) use ($format) { |
|
734 | + return $this->display(function($value) use ($format) { |
|
735 | 735 | return date($format, strtotime($value)); |
736 | 736 | }); |
737 | 737 | } |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | */ |
747 | 747 | public function bool(array $map = [], $default = false) |
748 | 748 | { |
749 | - return $this->display(function ($value) use ($map, $default) { |
|
749 | + return $this->display(function($value) use ($map, $default) { |
|
750 | 750 | $bool = empty($map) ? boolval($value) : Arr::get($map, $value, $default); |
751 | 751 | |
752 | 752 | return $bool ? '<i class="fa fa-check text-green"></i>' : '<i class="fa fa-close text-red"></i>'; |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | |
769 | 769 | $grid = $this->grid; |
770 | 770 | |
771 | - return $this->display(function ($_, $column) use ($action, $grid) { |
|
771 | + return $this->display(function($_, $column) use ($action, $grid) { |
|
772 | 772 | /** @var RowAction $action */ |
773 | 773 | $action = new $action(); |
774 | 774 | |
@@ -790,7 +790,7 @@ discard block |
||
790 | 790 | */ |
791 | 791 | public function dot($options = [], $default = '') |
792 | 792 | { |
793 | - return $this->prefix(function ($_, $original) use ($options, $default) { |
|
793 | + return $this->prefix(function($_, $original) use ($options, $default) { |
|
794 | 794 | if (is_null($original)) { |
795 | 795 | $style = $default; |
796 | 796 | } else { |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | $grid = $this->grid; |
918 | 918 | $column = $this; |
919 | 919 | |
920 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
920 | + $this->display(function($value) use ($grid, $column, $class) { |
|
921 | 921 | /** @var AbstractDisplayer $definition */ |
922 | 922 | $definition = new $class($value, $grid, $column, $this); |
923 | 923 | |
@@ -935,7 +935,7 @@ discard block |
||
935 | 935 | protected function htmlEntityEncode($item) |
936 | 936 | { |
937 | 937 | if (is_array($item)) { |
938 | - array_walk_recursive($item, function (&$value) { |
|
938 | + array_walk_recursive($item, function(&$value) { |
|
939 | 939 | $value = htmlentities($value); |
940 | 940 | }); |
941 | 941 | } else { |
@@ -972,7 +972,7 @@ discard block |
||
972 | 972 | */ |
973 | 973 | protected function callSupportDisplayer($abstract, $arguments) |
974 | 974 | { |
975 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
975 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
976 | 976 | if (is_array($value) || $value instanceof Arrayable) { |
977 | 977 | return call_user_func_array([collect($value), $abstract], $arguments); |
978 | 978 | } |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | protected function callBuiltinDisplayer($abstract, $arguments) |
997 | 997 | { |
998 | 998 | if ($abstract instanceof Closure) { |
999 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
999 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
1000 | 1000 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
1001 | 1001 | }); |
1002 | 1002 | } |
@@ -1005,7 +1005,7 @@ discard block |
||
1005 | 1005 | $grid = $this->grid; |
1006 | 1006 | $column = $this; |
1007 | 1007 | |
1008 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
1008 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
1009 | 1009 | /** @var AbstractDisplayer $displayer */ |
1010 | 1010 | $displayer = new $abstract($value, $grid, $column, $this); |
1011 | 1011 |
@@ -67,7 +67,7 @@ |
||
67 | 67 | { |
68 | 68 | Admin::script($this->script()); |
69 | 69 | |
70 | - $options = $this->getOptions()->map(function ($option) { |
|
70 | + $options = $this->getOptions()->map(function($option) { |
|
71 | 71 | $selected = ($option == $this->perPage) ? 'selected' : ''; |
72 | 72 | $url = \request()->fullUrlWithQuery([$this->perPageName => $option]); |
73 | 73 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | */ |
88 | 88 | public function render() |
89 | 89 | { |
90 | - $columns = $this->getVisibleColumns()->map(function (Column $column) { |
|
90 | + $columns = $this->getVisibleColumns()->map(function(Column $column) { |
|
91 | 91 | $name = $column->getName(); |
92 | 92 | |
93 | 93 | $total = ''; |
@@ -78,7 +78,7 @@ |
||
78 | 78 | { |
79 | 79 | $this->grid->setView($this->view); |
80 | 80 | |
81 | - return function (Grid $grid) { |
|
81 | + return function(Grid $grid) { |
|
82 | 82 | if ($this->head > 0) { |
83 | 83 | $this->left = $grid->visibleColumns()->slice(0, $this->head); |
84 | 84 | } |
@@ -105,7 +105,7 @@ |
||
105 | 105 | return []; |
106 | 106 | } |
107 | 107 | |
108 | - $selected = array_filter($selected, function ($value) { |
|
108 | + $selected = array_filter($selected, function($value) { |
|
109 | 109 | return !is_null($value); |
110 | 110 | }); |
111 | 111 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | $show = $this->grid->visibleColumnNames(); |
48 | 48 | |
49 | - $lists = $this->getGridColumns()->map(function ($label, $key) use ($show) { |
|
49 | + $lists = $this->getGridColumns()->map(function($label, $key) use ($show) { |
|
50 | 50 | if (empty($show)) { |
51 | 51 | $checked = 'checked'; |
52 | 52 | } else { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | protected function getGridColumns() |
100 | 100 | { |
101 | - return $this->grid->columns()->map(function (Grid\Column $column) { |
|
101 | + return $this->grid->columns()->map(function(Grid\Column $column) { |
|
102 | 102 | $name = $column->getName(); |
103 | 103 | |
104 | 104 | if ($this->isColumnIgnored($name)) { |
@@ -71,7 +71,7 @@ |
||
71 | 71 | 'total' => $this->paginator->total(), |
72 | 72 | ]; |
73 | 73 | |
74 | - $parameters = collect($parameters)->flatMap(function ($parameter, $key) { |
|
74 | + $parameters = collect($parameters)->flatMap(function($parameter, $key) { |
|
75 | 75 | return [$key => "<b>$parameter</b>"]; |
76 | 76 | }); |
77 | 77 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $this->value = $this->value->toArray(); |
14 | 14 | } |
15 | 15 | |
16 | - return collect((array) $this->value)->map(function ($name) use ($style) { |
|
16 | + return collect((array) $this->value)->map(function($name) use ($style) { |
|
17 | 17 | if (is_array($style)) { |
18 | 18 | $style = Arr::get($style, $this->getColumn()->getOriginal(), 'red'); |
19 | 19 | } |