@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | |
497 | 497 | $column = $this; |
498 | 498 | |
499 | - return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) { |
|
499 | + return $this->display(function($value) use ($grid, $column, $abstract, $arguments) { |
|
500 | 500 | /** @var AbstractDisplayer $displayer */ |
501 | 501 | $displayer = new $abstract($value, $grid, $column, $this); |
502 | 502 | |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | */ |
515 | 515 | public function using(array $values, $default = null) |
516 | 516 | { |
517 | - return $this->display(function ($value) use ($values, $default) { |
|
517 | + return $this->display(function($value) use ($values, $default) { |
|
518 | 518 | if (is_null($value)) { |
519 | 519 | return $default; |
520 | 520 | } |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | */ |
533 | 533 | public function replace(array $replacements) |
534 | 534 | { |
535 | - return $this->display(function ($value) use ($replacements) { |
|
535 | + return $this->display(function($value) use ($replacements) { |
|
536 | 536 | if (isset($replacements[$value])) { |
537 | 537 | return $replacements[$value]; |
538 | 538 | } |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | */ |
551 | 551 | public function view($view) |
552 | 552 | { |
553 | - return $this->display(function ($value) use ($view) { |
|
553 | + return $this->display(function($value) use ($view) { |
|
554 | 554 | $model = $this; |
555 | 555 | |
556 | 556 | return view($view, compact('model', 'value'))->render(); |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | */ |
591 | 591 | public function filesize() |
592 | 592 | { |
593 | - return $this->display(function ($value) { |
|
593 | + return $this->display(function($value) { |
|
594 | 594 | return file_size($value); |
595 | 595 | }); |
596 | 596 | } |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | */ |
605 | 605 | public function gravatar($size = 30) |
606 | 606 | { |
607 | - return $this->display(function ($value) use ($size) { |
|
607 | + return $this->display(function($value) use ($size) { |
|
608 | 608 | $src = sprintf( |
609 | 609 | 'https://www.gravatar.com/avatar/%s?s=%d', |
610 | 610 | md5(strtolower($value)), |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | */ |
626 | 626 | public function loading($values = [], $others = []) |
627 | 627 | { |
628 | - return $this->display(function ($value) use ($values, $others) { |
|
628 | + return $this->display(function($value) use ($values, $others) { |
|
629 | 629 | $values = (array) $values; |
630 | 630 | |
631 | 631 | if (in_array($value, $values)) { |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | */ |
647 | 647 | public function icon(array $setting, $default = '') |
648 | 648 | { |
649 | - return $this->display(function ($value) use ($setting, $default) { |
|
649 | + return $this->display(function($value) use ($setting, $default) { |
|
650 | 650 | $fa = ''; |
651 | 651 | |
652 | 652 | if (isset($setting[$value])) { |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | Carbon::setLocale($locale); |
673 | 673 | } |
674 | 674 | |
675 | - return $this->display(function ($value) { |
|
675 | + return $this->display(function($value) { |
|
676 | 676 | return Carbon::parse($value)->diffForHumans(); |
677 | 677 | }); |
678 | 678 | } |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | */ |
687 | 687 | public function date($format) |
688 | 688 | { |
689 | - return $this->display(function ($value) use ($format) { |
|
689 | + return $this->display(function($value) use ($format) { |
|
690 | 690 | return date($format, strtotime($value)); |
691 | 691 | }); |
692 | 692 | } |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | */ |
702 | 702 | public function bool(array $map = [], $default = false) |
703 | 703 | { |
704 | - return $this->display(function ($value) use ($map, $default) { |
|
704 | + return $this->display(function($value) use ($map, $default) { |
|
705 | 705 | $bool = empty($map) ? boolval($value) : Arr::get($map, $value, $default); |
706 | 706 | |
707 | 707 | return $bool ? '<i class="fa fa-check text-green"></i>' : '<i class="fa fa-close text-red"></i>'; |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | $grid = $this->grid; |
825 | 825 | $column = $this; |
826 | 826 | |
827 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
827 | + $this->display(function($value) use ($grid, $column, $class) { |
|
828 | 828 | /** @var AbstractDisplayer $definition */ |
829 | 829 | $definition = new $class($value, $grid, $column, $this); |
830 | 830 | |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | protected function htmlEntityEncode($item) |
843 | 843 | { |
844 | 844 | if (is_array($item)) { |
845 | - array_walk_recursive($item, function (&$value) { |
|
845 | + array_walk_recursive($item, function(&$value) { |
|
846 | 846 | $value = htmlentities($value); |
847 | 847 | }); |
848 | 848 | } else { |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | */ |
880 | 880 | protected function callSupportDisplayer($abstract, $arguments) |
881 | 881 | { |
882 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
882 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
883 | 883 | if (is_array($value) || $value instanceof Arrayable) { |
884 | 884 | return call_user_func_array([collect($value), $abstract], $arguments); |
885 | 885 | } |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | protected function callBuiltinDisplayer($abstract, $arguments) |
904 | 904 | { |
905 | 905 | if ($abstract instanceof Closure) { |
906 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
906 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
907 | 907 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
908 | 908 | }); |
909 | 909 | } |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | $grid = $this->grid; |
913 | 913 | $column = $this; |
914 | 914 | |
915 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
915 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
916 | 916 | /** @var AbstractDisplayer $displayer */ |
917 | 917 | $displayer = new $abstract($value, $grid, $column, $this); |
918 | 918 |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | return $content |
27 | 27 | ->title(trans('admin.menu')) |
28 | 28 | ->description(trans('admin.list')) |
29 | - ->row(function (Row $row) { |
|
29 | + ->row(function(Row $row) { |
|
30 | 30 | $row->column(6, $this->treeView()->render()); |
31 | 31 | |
32 | - $row->column(6, function (Column $column) { |
|
32 | + $row->column(6, function(Column $column) { |
|
33 | 33 | $form = new \Encore\Admin\Widgets\Form(); |
34 | 34 | $form->action(admin_url('auth/menu')); |
35 | 35 | |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | { |
72 | 72 | $menuModel = config('admin.database.menu_model'); |
73 | 73 | |
74 | - return $menuModel::tree(function (Tree $tree) { |
|
74 | + return $menuModel::tree(function(Tree $tree) { |
|
75 | 75 | $tree->disableCreate(); |
76 | 76 | |
77 | - $tree->branch(function ($branch) { |
|
77 | + $tree->branch(function($branch) { |
|
78 | 78 | $payload = "<i class='fa {$branch['icon']}'></i> <strong>{$branch['title']}</strong>"; |
79 | 79 | |
80 | 80 | if (!isset($branch['children'])) { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | $form = $this->settingForm(); |
97 | 97 | $form->tools( |
98 | - function (Form\Tools $tools) { |
|
98 | + function(Form\Tools $tools) { |
|
99 | 99 | $tools->disableList(); |
100 | 100 | $tools->disableDelete(); |
101 | 101 | $tools->disableView(); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $form->image('avatar', trans('admin.avatar')); |
134 | 134 | $form->password('password', trans('admin.password'))->rules('confirmed|required'); |
135 | 135 | $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required') |
136 | - ->default(function ($form) { |
|
136 | + ->default(function($form) { |
|
137 | 137 | return $form->model()->password; |
138 | 138 | }); |
139 | 139 | |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | |
142 | 142 | $form->ignore(['password_confirmation']); |
143 | 143 | |
144 | - $form->saving(function (Form $form) { |
|
144 | + $form->saving(function(Form $form) { |
|
145 | 145 | if ($form->password && $form->model()->password != $form->password) { |
146 | 146 | $form->password = bcrypt($form->password); |
147 | 147 | } |
148 | 148 | }); |
149 | 149 | |
150 | - $form->saved(function () { |
|
150 | + $form->saved(function() { |
|
151 | 151 | admin_toastr(trans('admin.update_succeeded')); |
152 | 152 | |
153 | 153 | return redirect(admin_url('auth/setting')); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function using(array $values, $default = null) |
194 | 194 | { |
195 | - return $this->as(function ($value) use ($values, $default) { |
|
195 | + return $this->as(function($value) use ($values, $default) { |
|
196 | 196 | if (is_null($value)) { |
197 | 197 | return $default; |
198 | 198 | } |
@@ -212,12 +212,12 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function image($server = '', $width = 200, $height = 200, $is_zoom = false) |
214 | 214 | { |
215 | - if ($is_zoom){ |
|
215 | + if ($is_zoom) { |
|
216 | 216 | Admin::css('/vendor/laravel-admin/image-zoom/zoom.css'); |
217 | 217 | Admin::js('/vendor/laravel-admin/image-zoom/zoom.js'); |
218 | 218 | } |
219 | - return $this->unescape()->as(function ($images) use ($server, $width, $height, $is_zoom) { |
|
220 | - return collect($images)->map(function ($path) use ($server, $width, $height, $is_zoom) { |
|
219 | + return $this->unescape()->as(function($images) use ($server, $width, $height, $is_zoom) { |
|
220 | + return collect($images)->map(function($path) use ($server, $width, $height, $is_zoom) { |
|
221 | 221 | if (empty($path)) { |
222 | 222 | return ''; |
223 | 223 | } |
@@ -252,8 +252,8 @@ discard block |
||
252 | 252 | */ |
253 | 253 | public function carousel($width = 300, $height = 200, $server = '') |
254 | 254 | { |
255 | - return $this->unescape()->as(function ($images) use ($server, $width, $height) { |
|
256 | - $items = collect($images)->map(function ($path) use ($server, $width, $height) { |
|
255 | + return $this->unescape()->as(function($images) use ($server, $width, $height) { |
|
256 | + $items = collect($images)->map(function($path) use ($server, $width, $height) { |
|
257 | 257 | if (empty($path)) { |
258 | 258 | return ''; |
259 | 259 | } |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | { |
294 | 294 | $field = $this; |
295 | 295 | |
296 | - return $this->unescape()->as(function ($path) use ($server, $download, $field) { |
|
296 | + return $this->unescape()->as(function($path) use ($server, $download, $field) { |
|
297 | 297 | $name = basename($path); |
298 | 298 | |
299 | 299 | $field->border = false; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | */ |
348 | 348 | public function link($href = '', $target = '_blank') |
349 | 349 | { |
350 | - return $this->unescape()->as(function ($link) use ($href, $target) { |
|
350 | + return $this->unescape()->as(function($link) use ($href, $target) { |
|
351 | 351 | $href = $href ?: $link; |
352 | 352 | |
353 | 353 | return "<a href='$href' target='{$target}'>{$link}</a>"; |
@@ -363,12 +363,12 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function label($style = 'success') |
365 | 365 | { |
366 | - return $this->unescape()->as(function ($value) use ($style) { |
|
366 | + return $this->unescape()->as(function($value) use ($style) { |
|
367 | 367 | if ($value instanceof Arrayable) { |
368 | 368 | $value = $value->toArray(); |
369 | 369 | } |
370 | 370 | |
371 | - return collect((array) $value)->map(function ($name) use ($style) { |
|
371 | + return collect((array) $value)->map(function($name) use ($style) { |
|
372 | 372 | return "<span class='label label-{$style}'>$name</span>"; |
373 | 373 | })->implode(' '); |
374 | 374 | }); |
@@ -383,12 +383,12 @@ discard block |
||
383 | 383 | */ |
384 | 384 | public function badge($style = 'blue') |
385 | 385 | { |
386 | - return $this->unescape()->as(function ($value) use ($style) { |
|
386 | + return $this->unescape()->as(function($value) use ($style) { |
|
387 | 387 | if ($value instanceof Arrayable) { |
388 | 388 | $value = $value->toArray(); |
389 | 389 | } |
390 | 390 | |
391 | - return collect((array) $value)->map(function ($name) use ($style) { |
|
391 | + return collect((array) $value)->map(function($name) use ($style) { |
|
392 | 392 | return "<span class='badge bg-{$style}'>$name</span>"; |
393 | 393 | })->implode(' '); |
394 | 394 | }); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | { |
404 | 404 | $field = $this; |
405 | 405 | |
406 | - return $this->unescape()->as(function ($value) use ($field) { |
|
406 | + return $this->unescape()->as(function($value) use ($field) { |
|
407 | 407 | $content = json_decode($value, true); |
408 | 408 | |
409 | 409 | if (json_last_error() == 0) { |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | */ |
424 | 424 | public function filesize() |
425 | 425 | { |
426 | - return $this->as(function ($value) { |
|
426 | + return $this->as(function($value) { |
|
427 | 427 | return file_size($value); |
428 | 428 | }); |
429 | 429 | } |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | |
563 | 563 | $field = $this; |
564 | 564 | |
565 | - return $this->as(function ($value) use ($extend, $field, $arguments) { |
|
565 | + return $this->as(function($value) use ($extend, $field, $arguments) { |
|
566 | 566 | if (!$extend->border) { |
567 | 567 | $field->border = false; |
568 | 568 | } |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | public function render() |
622 | 622 | { |
623 | 623 | if ($this->showAs->isNotEmpty()) { |
624 | - $this->showAs->each(function ($callable) { |
|
624 | + $this->showAs->each(function($callable) { |
|
625 | 625 | $this->value = $callable->call( |
626 | 626 | $this->parent->getModel(), |
627 | 627 | $this->value |