@@ -125,7 +125,7 @@ |
||
125 | 125 | $value = explode($this->separator, $value); |
126 | 126 | } |
127 | 127 | |
128 | - return collect(Arr::wrap($value))->map(function ($item) use ($field) { |
|
128 | + return collect(Arr::wrap($value))->map(function($item) use ($field) { |
|
129 | 129 | return [ |
130 | 130 | 'url' => $this->field->objectUrl($item), |
131 | 131 | 'value' => $item, |
@@ -27,7 +27,7 @@ |
||
27 | 27 | return Admin::component('admin::components.column-expand', [ |
28 | 28 | 'key' => $this->getKey(), |
29 | 29 | 'url' => $this->getLoadUrl(), |
30 | - 'name' => $this->column->getName() . '-' . $this->getKey(), |
|
30 | + 'name' => $this->column->getName().'-'.$this->getKey(), |
|
31 | 31 | 'html' => $html, |
32 | 32 | 'value' => $this->value, |
33 | 33 | 'async' => $async, |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $title = $this->trans('title'); |
39 | 39 | } |
40 | 40 | |
41 | - $html = ''; |
|
41 | + $html = ''; |
|
42 | 42 | |
43 | 43 | if ($async = is_subclass_of($callback, Renderable::class)) { |
44 | 44 | $this->renderable = $callback; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'html' => $html, |
55 | 55 | 'key' => $this->getKey(), |
56 | 56 | 'value' => $this->value, |
57 | - 'name' => $this->getKey() . '-' . str_replace('.', '_', $this->getColumn()->getName()), |
|
57 | + 'name' => $this->getKey().'-'.str_replace('.', '_', $this->getColumn()->getName()), |
|
58 | 58 | ]); |
59 | 59 | } |
60 | 60 | } |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | $name = $this->getName(); |
493 | 493 | $query = request()->query(); |
494 | 494 | |
495 | - $this->prefix(function ($_, $original) use ($name, $query) { |
|
495 | + $this->prefix(function($_, $original) use ($name, $query) { |
|
496 | 496 | Arr::set($query, $name, $original); |
497 | 497 | |
498 | 498 | $url = request()->fullUrlWithQuery($query); |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | |
544 | 544 | $column = $this; |
545 | 545 | |
546 | - return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) { |
|
546 | + return $this->display(function($value) use ($grid, $column, $abstract, $arguments) { |
|
547 | 547 | /** @var AbstractDisplayer $displayer */ |
548 | 548 | $displayer = new $abstract($value, $grid, $column, $this); |
549 | 549 | |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | */ |
562 | 562 | public function using(array $values, $default = null) |
563 | 563 | { |
564 | - return $this->display(function ($value) use ($values, $default) { |
|
564 | + return $this->display(function($value) use ($values, $default) { |
|
565 | 565 | if (is_null($value)) { |
566 | 566 | return $default; |
567 | 567 | } |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | */ |
580 | 580 | public function replace(array $replacements) |
581 | 581 | { |
582 | - return $this->display(function ($value) use ($replacements) { |
|
582 | + return $this->display(function($value) use ($replacements) { |
|
583 | 583 | if (isset($replacements[$value])) { |
584 | 584 | return $replacements[$value]; |
585 | 585 | } |
@@ -597,13 +597,13 @@ discard block |
||
597 | 597 | public function repeat($input, $seperator = '') |
598 | 598 | { |
599 | 599 | if (is_string($input)) { |
600 | - $input = function () use ($input) { |
|
600 | + $input = function() use ($input) { |
|
601 | 601 | return $input; |
602 | 602 | }; |
603 | 603 | } |
604 | 604 | |
605 | 605 | if ($input instanceof Closure) { |
606 | - return $this->display(function ($value) use ($input, $seperator) { |
|
606 | + return $this->display(function($value) use ($input, $seperator) { |
|
607 | 607 | return join($seperator, array_fill(0, (int) $value, $input->call($this, [$value]))); |
608 | 608 | }); |
609 | 609 | } |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | */ |
621 | 621 | public function view($view) |
622 | 622 | { |
623 | - return $this->display(function ($value) use ($view) { |
|
623 | + return $this->display(function($value) use ($view) { |
|
624 | 624 | $model = $this; |
625 | 625 | |
626 | 626 | return view($view, compact('model', 'value'))->render(); |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | */ |
661 | 661 | public function filesize() |
662 | 662 | { |
663 | - return $this->display(function ($value) { |
|
663 | + return $this->display(function($value) { |
|
664 | 664 | return file_size($value); |
665 | 665 | }); |
666 | 666 | } |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | */ |
675 | 675 | public function gravatar($size = 30) |
676 | 676 | { |
677 | - return $this->display(function ($value) use ($size) { |
|
677 | + return $this->display(function($value) use ($size) { |
|
678 | 678 | $src = sprintf( |
679 | 679 | 'https://www.gravatar.com/avatar/%s?s=%d', |
680 | 680 | md5(strtolower($value)), |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | */ |
696 | 696 | public function loading($values = [], $others = []) |
697 | 697 | { |
698 | - return $this->display(function ($value) use ($values, $others) { |
|
698 | + return $this->display(function($value) use ($values, $others) { |
|
699 | 699 | $values = (array) $values; |
700 | 700 | |
701 | 701 | if (in_array($value, $values)) { |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | */ |
717 | 717 | public function icon(array $setting, $default = '') |
718 | 718 | { |
719 | - return $this->display(function ($value) use ($setting, $default) { |
|
719 | + return $this->display(function($value) use ($setting, $default) { |
|
720 | 720 | $fa = ''; |
721 | 721 | |
722 | 722 | if (isset($setting[$value])) { |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | Carbon::setLocale($locale); |
743 | 743 | } |
744 | 744 | |
745 | - return $this->display(function ($value) { |
|
745 | + return $this->display(function($value) { |
|
746 | 746 | return Carbon::parse($value)->diffForHumans(); |
747 | 747 | }); |
748 | 748 | } |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | */ |
757 | 757 | public function date($format) |
758 | 758 | { |
759 | - return $this->display(function ($value) use ($format) { |
|
759 | + return $this->display(function($value) use ($format) { |
|
760 | 760 | return date($format, strtotime($value)); |
761 | 761 | }); |
762 | 762 | } |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | */ |
772 | 772 | public function bool(array $map = [], $default = false) |
773 | 773 | { |
774 | - return $this->display(function ($value) use ($map, $default) { |
|
774 | + return $this->display(function($value) use ($map, $default) { |
|
775 | 775 | $bool = empty($map) ? boolval($value) : Arr::get($map, $value, $default); |
776 | 776 | |
777 | 777 | return $bool ? '<i class="fa fa-check text-green"></i>' : '<i class="fa fa-close text-red"></i>'; |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | */ |
787 | 787 | public function default($default = '-') |
788 | 788 | { |
789 | - return $this->display(function ($value) use ($default) { |
|
789 | + return $this->display(function($value) use ($default) { |
|
790 | 790 | return $value ?: $default; |
791 | 791 | }); |
792 | 792 | } |
@@ -806,7 +806,7 @@ discard block |
||
806 | 806 | |
807 | 807 | $grid = $this->grid; |
808 | 808 | |
809 | - return $this->display(function ($_, $column) use ($action, $grid) { |
|
809 | + return $this->display(function($_, $column) use ($action, $grid) { |
|
810 | 810 | /** @var RowAction $action */ |
811 | 811 | $action = new $action(); |
812 | 812 | |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | */ |
829 | 829 | public function dot($options = [], $default = '') |
830 | 830 | { |
831 | - return $this->prefix(function ($_, $original) use ($options, $default) { |
|
831 | + return $this->prefix(function($_, $original) use ($options, $default) { |
|
832 | 832 | if (is_null($original)) { |
833 | 833 | $style = $default; |
834 | 834 | } else { |
@@ -983,7 +983,7 @@ discard block |
||
983 | 983 | $grid = $this->grid; |
984 | 984 | $column = $this; |
985 | 985 | |
986 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
986 | + $this->display(function($value) use ($grid, $column, $class) { |
|
987 | 987 | /** @var AbstractDisplayer $definition */ |
988 | 988 | $definition = new $class($value, $grid, $column, $this); |
989 | 989 | |
@@ -1001,7 +1001,7 @@ discard block |
||
1001 | 1001 | protected function htmlEntityEncode($item) |
1002 | 1002 | { |
1003 | 1003 | if (is_array($item)) { |
1004 | - array_walk_recursive($item, function (&$value) { |
|
1004 | + array_walk_recursive($item, function(&$value) { |
|
1005 | 1005 | $value = htmlentities($value); |
1006 | 1006 | }); |
1007 | 1007 | } else { |
@@ -1038,7 +1038,7 @@ discard block |
||
1038 | 1038 | */ |
1039 | 1039 | protected function callSupportDisplayer($abstract, $arguments) |
1040 | 1040 | { |
1041 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
1041 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
1042 | 1042 | if (is_array($value) || $value instanceof Arrayable) { |
1043 | 1043 | return call_user_func_array([collect($value), $abstract], $arguments); |
1044 | 1044 | } |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | protected function callBuiltinDisplayer($abstract, $arguments) |
1063 | 1063 | { |
1064 | 1064 | if ($abstract instanceof Closure) { |
1065 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
1065 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
1066 | 1066 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
1067 | 1067 | }); |
1068 | 1068 | } |
@@ -1071,7 +1071,7 @@ discard block |
||
1071 | 1071 | $grid = $this->grid; |
1072 | 1072 | $column = $this; |
1073 | 1073 | |
1074 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
1074 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
1075 | 1075 | /** @var AbstractDisplayer $displayer */ |
1076 | 1076 | $displayer = new $abstract($value, $grid, $column, $this); |
1077 | 1077 |
@@ -20,6 +20,4 @@ |
||
20 | 20 | }); |
21 | 21 | SCRIPT); |
22 | 22 | |
23 | - return $this; |
|
24 | - } |
|
25 | -} |
|
23 | + return $this |
|
26 | 24 | \ No newline at end of file |
@@ -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 | list($relationName, $relationColumn) = explode('.', $columnName); |
530 | 530 | return $query['method'] === 'with' && in_array($relationName, $query['arguments'], true); |
531 | 531 | }); |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | { |
573 | 573 | list($relationName, $relationColumn) = explode('.', $column); |
574 | 574 | |
575 | - if ($this->queries->contains(function ($query) use ($relationName) { |
|
575 | + if ($this->queries->contains(function($query) use ($relationName) { |
|
576 | 576 | return $query['method'] == 'with' && in_array($relationName, $query['arguments']); |
577 | 577 | })) { |
578 | 578 | $relation = $this->model->$relationName(); |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | */ |
607 | 607 | public function resetOrderBy() |
608 | 608 | { |
609 | - $this->queries = $this->queries->reject(function ($query) { |
|
609 | + $this->queries = $this->queries->reject(function($query) { |
|
610 | 610 | return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc'; |
611 | 611 | }); |
612 | 612 | } |