@@ -169,7 +169,7 @@ |
||
169 | 169 | $image = InterventionImage::make($file); |
170 | 170 | |
171 | 171 | // Resize image with aspect ratio |
172 | - $image->resize($size[0], $size[1], function (Constraint $constraint) { |
|
172 | + $image->resize($size[0], $size[1], function(Constraint $constraint) { |
|
173 | 173 | $constraint->aspectRatio(); |
174 | 174 | })->resizeCanvas($size[0], $size[1], 'center', false, '#ffffff'); |
175 | 175 |
@@ -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)) { |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $this->value = $this->value->toArray(); |
14 | 14 | } |
15 | 15 | |
16 | - return collect((array) $this->value)->map(function ($item) use ($style) { |
|
16 | + return collect((array) $this->value)->map(function($item) use ($style) { |
|
17 | 17 | if (is_array($style)) { |
18 | 18 | $style = Arr::get($style, $this->getColumn()->getOriginal(), 'success'); |
19 | 19 | } |
@@ -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 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $this->value = $this->value->toArray(); |
14 | 14 | } |
15 | 15 | |
16 | - return collect((array) $this->value)->filter()->map(function ($value) use ($server) { |
|
16 | + return collect((array) $this->value)->filter()->map(function($value) use ($server) { |
|
17 | 17 | if (empty($value)) { |
18 | 18 | return ''; |
19 | 19 | } |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | |
420 | 420 | $column = $this; |
421 | 421 | |
422 | - return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) { |
|
422 | + return $this->display(function($value) use ($grid, $column, $abstract, $arguments) { |
|
423 | 423 | /** @var AbstractDisplayer $displayer */ |
424 | 424 | $displayer = new $abstract($value, $grid, $column, $this); |
425 | 425 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | */ |
438 | 438 | public function using(array $values, $default = null) |
439 | 439 | { |
440 | - return $this->display(function ($value) use ($values, $default) { |
|
440 | + return $this->display(function($value) use ($values, $default) { |
|
441 | 441 | if (is_null($value)) { |
442 | 442 | return $default; |
443 | 443 | } |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | */ |
456 | 456 | public function replace(array $replacements) |
457 | 457 | { |
458 | - return $this->display(function ($value) use ($replacements) { |
|
458 | + return $this->display(function($value) use ($replacements) { |
|
459 | 459 | if (isset($replacements[$value])) { |
460 | 460 | return $replacements[$value]; |
461 | 461 | } |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | */ |
474 | 474 | public function view($view) |
475 | 475 | { |
476 | - return $this->display(function ($value) use ($view) { |
|
476 | + return $this->display(function($value) use ($view) { |
|
477 | 477 | $model = $this; |
478 | 478 | |
479 | 479 | return view($view, compact('model', 'value'))->render(); |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | */ |
514 | 514 | public function filesize() |
515 | 515 | { |
516 | - return $this->display(function ($value) { |
|
516 | + return $this->display(function($value) { |
|
517 | 517 | return file_size($value); |
518 | 518 | }); |
519 | 519 | } |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | */ |
528 | 528 | public function gravatar($size = 30) |
529 | 529 | { |
530 | - return $this->display(function ($value) use ($size) { |
|
530 | + return $this->display(function($value) use ($size) { |
|
531 | 531 | $src = sprintf( |
532 | 532 | 'https://www.gravatar.com/avatar/%s?s=%d', |
533 | 533 | md5(strtolower($value)), |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | */ |
549 | 549 | public function loading($values = [], $others = []) |
550 | 550 | { |
551 | - return $this->display(function ($value) use ($values, $others) { |
|
551 | + return $this->display(function($value) use ($values, $others) { |
|
552 | 552 | $values = (array) $values; |
553 | 553 | |
554 | 554 | if (in_array($value, $values)) { |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | */ |
570 | 570 | public function icon(array $setting, $default = '') |
571 | 571 | { |
572 | - return $this->display(function ($value) use ($setting, $default) { |
|
572 | + return $this->display(function($value) use ($setting, $default) { |
|
573 | 573 | $fa = ''; |
574 | 574 | |
575 | 575 | if (isset($setting[$value])) { |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | Carbon::setLocale($locale); |
596 | 596 | } |
597 | 597 | |
598 | - return $this->display(function ($value) { |
|
598 | + return $this->display(function($value) { |
|
599 | 599 | return Carbon::parse($value)->diffForHumans(); |
600 | 600 | }); |
601 | 601 | } |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | $grid = $this->grid; |
717 | 717 | $column = $this; |
718 | 718 | |
719 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
719 | + $this->display(function($value) use ($grid, $column, $class) { |
|
720 | 720 | /** @var AbstractDisplayer $definition */ |
721 | 721 | $definition = new $class($value, $grid, $column, $this); |
722 | 722 | |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | protected function htmlEntityEncode($item) |
735 | 735 | { |
736 | 736 | if (is_array($item)) { |
737 | - array_walk_recursive($item, function (&$value) { |
|
737 | + array_walk_recursive($item, function(&$value) { |
|
738 | 738 | $value = htmlentities($value); |
739 | 739 | }); |
740 | 740 | } else { |
@@ -822,7 +822,7 @@ discard block |
||
822 | 822 | 'content' => $this->help, |
823 | 823 | ]; |
824 | 824 | |
825 | - $data = collect($data)->map(function ($val, $key) { |
|
825 | + $data = collect($data)->map(function($val, $key) { |
|
826 | 826 | return "data-{$key}=\"{$val}\""; |
827 | 827 | })->implode(' '); |
828 | 828 | |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | */ |
861 | 861 | protected function callSupportDisplayer($abstract, $arguments) |
862 | 862 | { |
863 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
863 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
864 | 864 | if (is_array($value) || $value instanceof Arrayable) { |
865 | 865 | return call_user_func_array([collect($value), $abstract], $arguments); |
866 | 866 | } |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | protected function callBuiltinDisplayer($abstract, $arguments) |
885 | 885 | { |
886 | 886 | if ($abstract instanceof Closure) { |
887 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
887 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
888 | 888 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
889 | 889 | }); |
890 | 890 | } |
@@ -893,7 +893,7 @@ discard block |
||
893 | 893 | $grid = $this->grid; |
894 | 894 | $column = $this; |
895 | 895 | |
896 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
896 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
897 | 897 | /** @var AbstractDisplayer $displayer */ |
898 | 898 | $displayer = new $abstract($value, $grid, $column, $this); |
899 | 899 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | if (is_array($permission)) { |
25 | - collect($permission)->each(function ($permission) { |
|
25 | + collect($permission)->each(function($permission) { |
|
26 | 26 | call_user_func([self::class, 'check'], $permission); |
27 | 27 | }); |
28 | 28 |
@@ -137,19 +137,19 @@ discard block |
||
137 | 137 | $resource = Str::kebab(Str::camel($table)); |
138 | 138 | switch ($permission) { |
139 | 139 | case 'create': |
140 | - $http_path = '/' . $resource; |
|
140 | + $http_path = '/'.$resource; |
|
141 | 141 | break; |
142 | 142 | case 'edit': |
143 | - $http_path = '/' . $resource . '/*'; |
|
143 | + $http_path = '/'.$resource.'/*'; |
|
144 | 144 | break; |
145 | 145 | case 'delete': |
146 | - $http_path = '/' . $resource . '/*'; |
|
146 | + $http_path = '/'.$resource.'/*'; |
|
147 | 147 | break; |
148 | 148 | case 'index': |
149 | - $http_path = '/' . $resource; |
|
149 | + $http_path = '/'.$resource; |
|
150 | 150 | break; |
151 | 151 | case 'view': |
152 | - $http_path = '/' . $resource . '/*'; |
|
152 | + $http_path = '/'.$resource.'/*'; |
|
153 | 153 | break; |
154 | 154 | default: |
155 | 155 | $http_path = ''; |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | |
161 | 161 | private function generateSlug($table, $permission) |
162 | 162 | { |
163 | - return Str::kebab(Str::camel($table)) . '.' . $permission; |
|
163 | + return Str::kebab(Str::camel($table)).'.'.$permission; |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | private function generateName($table, $permission_zh) |
167 | 167 | { |
168 | - return Str::upper(Str::kebab(Str::camel($table))) . $permission_zh; |
|
168 | + return Str::upper(Str::kebab(Str::camel($table))).$permission_zh; |
|
169 | 169 | } |
170 | 170 | } |