@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function index() |
23 | 23 | { |
24 | - return Admin::content(function (Content $content) { |
|
24 | + return Admin::content(function(Content $content) { |
|
25 | 25 | $content->header(trans('admin::lang.roles')); |
26 | 26 | $content->description(trans('admin::lang.list')); |
27 | 27 | $content->body($this->grid()->render()); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function edit($id) |
39 | 39 | { |
40 | - return Admin::content(function (Content $content) use ($id) { |
|
40 | + return Admin::content(function(Content $content) use ($id) { |
|
41 | 41 | $content->header(trans('admin::lang.roles')); |
42 | 42 | $content->description(trans('admin::lang.edit')); |
43 | 43 | $content->body($this->form()->edit($id)); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function create() |
53 | 53 | { |
54 | - return Admin::content(function (Content $content) { |
|
54 | + return Admin::content(function(Content $content) { |
|
55 | 55 | $content->header(trans('admin::lang.roles')); |
56 | 56 | $content->description(trans('admin::lang.create')); |
57 | 57 | $content->body($this->form()); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | protected function grid() |
67 | 67 | { |
68 | - return Admin::grid(Role::class, function (Grid $grid) { |
|
68 | + return Admin::grid(Role::class, function(Grid $grid) { |
|
69 | 69 | $grid->id('ID')->sortable(); |
70 | 70 | $grid->slug(trans('admin::lang.slug')); |
71 | 71 | $grid->name(trans('admin::lang.name')); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $grid->created_at(trans('admin::lang.created_at')); |
74 | 74 | $grid->updated_at(trans('admin::lang.updated_at')); |
75 | 75 | |
76 | - $grid->rows(function ($row) { |
|
76 | + $grid->rows(function($row) { |
|
77 | 77 | if ($row->slug == 'administrator') { |
78 | 78 | $row->actions('edit'); |
79 | 79 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function form() |
90 | 90 | { |
91 | - return Admin::form(Role::class, function (Form $form) { |
|
91 | + return Admin::form(Role::class, function(Form $form) { |
|
92 | 92 | $form->display('id', 'ID'); |
93 | 93 | |
94 | 94 | $form->text('slug', trans('admin::lang.slug'))->rules('required'); |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | $data = $this->model->with($this->getRelations()) |
232 | 232 | ->findOrFail($id)->toArray(); |
233 | 233 | |
234 | - $this->builder->fields()->filter(function ($field) { |
|
234 | + $this->builder->fields()->filter(function($field) { |
|
235 | 235 | return $field instanceof Field\File; |
236 | - })->each(function (File $file) use ($data) { |
|
236 | + })->each(function(File $file) use ($data) { |
|
237 | 237 | $file->setOriginal($data); |
238 | 238 | |
239 | 239 | $file->destroy(); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | $this->prepare($data, $this->saving); |
257 | 257 | |
258 | - DB::transaction(function () { |
|
258 | + DB::transaction(function() { |
|
259 | 259 | $inserts = $this->prepareInsert($this->updates); |
260 | 260 | |
261 | 261 | foreach ($inserts as $column => $value) { |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | |
294 | 294 | $updates = array_except($this->inputs, array_keys($this->relations)); |
295 | 295 | |
296 | - $this->updates = array_filter($updates, function ($val) { |
|
296 | + $this->updates = array_filter($updates, function($val) { |
|
297 | 297 | return !is_null($val); |
298 | 298 | }); |
299 | 299 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | |
391 | 391 | $this->prepare($data, $this->saving); |
392 | 392 | |
393 | - DB::transaction(function () { |
|
393 | + DB::transaction(function() { |
|
394 | 394 | $updates = $this->prepareUpdate($this->updates); |
395 | 395 | |
396 | 396 | foreach ($updates as $column => $value) { |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | protected function getFieldByColumn($column) |
591 | 591 | { |
592 | 592 | return $this->builder->fields()->first( |
593 | - function ($index, Field $field) use ($column) { |
|
593 | + function($index, Field $field) use ($column) { |
|
594 | 594 | if (is_array($field->column())) { |
595 | 595 | return in_array($column, $field->column()); |
596 | 596 | } |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | { |
610 | 610 | $values = $this->model->toArray(); |
611 | 611 | |
612 | - $this->builder->fields()->each(function (Field $field) use ($values) { |
|
612 | + $this->builder->fields()->each(function(Field $field) use ($values) { |
|
613 | 613 | $field->setOriginal($values); |
614 | 614 | }); |
615 | 615 | } |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | |
630 | 630 | $data = $this->model->toArray(); |
631 | 631 | |
632 | - $this->builder->fields()->each(function (Field $field) use ($data) { |
|
632 | + $this->builder->fields()->each(function(Field $field) use ($data) { |
|
633 | 633 | $field->fill($data); |
634 | 634 | }); |
635 | 635 | } |
@@ -18,23 +18,23 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function index() |
20 | 20 | { |
21 | - return Admin::content(function (Content $content) { |
|
21 | + return Admin::content(function(Content $content) { |
|
22 | 22 | $content->header(trans('admin::lang.operation_log')); |
23 | 23 | $content->description(trans('admin::lang.list')); |
24 | 24 | |
25 | - $grid = Admin::grid(OperationLog::class, function (Grid $grid) { |
|
25 | + $grid = Admin::grid(OperationLog::class, function(Grid $grid) { |
|
26 | 26 | $grid->model()->orderBy('id', 'DESC'); |
27 | 27 | |
28 | 28 | $grid->id('ID')->sortable(); |
29 | 29 | $grid->user()->name(); |
30 | - $grid->method()->value(function ($method) { |
|
30 | + $grid->method()->value(function($method) { |
|
31 | 31 | $color = array_get(OperationLog::$methodColors, $method, 'grey'); |
32 | 32 | |
33 | 33 | return "<span class=\"badge bg-$color\">$method</span>"; |
34 | 34 | }); |
35 | 35 | $grid->path()->label('info'); |
36 | 36 | $grid->ip()->label('primary'); |
37 | - $grid->input()->value(function ($input) { |
|
37 | + $grid->input()->value(function($input) { |
|
38 | 38 | $input = json_decode($input, true); |
39 | 39 | $input = array_except($input, '_pjax'); |
40 | 40 | |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | |
44 | 44 | $grid->created_at(trans('admin::lang.created_at')); |
45 | 45 | |
46 | - $grid->rows(function ($row) { |
|
46 | + $grid->rows(function($row) { |
|
47 | 47 | $row->actions('delete'); |
48 | 48 | }); |
49 | 49 | |
50 | - $grid->filter(function ($filter) { |
|
50 | + $grid->filter(function($filter) { |
|
51 | 51 | $filter->is('user_id', 'User')->select(Administrator::all()->pluck('name', 'id')); |
52 | 52 | $filter->is('method')->select(array_combine(OperationLog::$methods, OperationLog::$methods)); |
53 | 53 | $filter->like('path'); |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function index() |
25 | 25 | { |
26 | - return Admin::content(function (Content $content) { |
|
26 | + return Admin::content(function(Content $content) { |
|
27 | 27 | $content->header(trans('admin::lang.menu')); |
28 | 28 | $content->description(trans('admin::lang.list')); |
29 | 29 | |
30 | - $content->row(function (Row $row) { |
|
31 | - $row->column(5, function (Column $column) { |
|
30 | + $content->row(function(Row $row) { |
|
31 | + $row->column(5, function(Column $column) { |
|
32 | 32 | $column->append($this->callout()); |
33 | 33 | |
34 | 34 | $form = new \Encore\Admin\Widgets\Form(); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function edit($id) |
64 | 64 | { |
65 | - return Admin::content(function (Content $content) use ($id) { |
|
65 | + return Admin::content(function(Content $content) use ($id) { |
|
66 | 66 | $content->header(trans('admin::lang.menu')); |
67 | 67 | $content->description(trans('admin::lang.edit')); |
68 | 68 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function form() |
118 | 118 | { |
119 | - return Admin::form(MenuModel::class, function (Form $form) { |
|
119 | + return Admin::form(MenuModel::class, function(Form $form) { |
|
120 | 120 | $form->display('id', 'ID'); |
121 | 121 | |
122 | 122 | $options = [0 => 'Root'] + MenuModel::buildSelectOptions(); |
@@ -68,7 +68,7 @@ |
||
68 | 68 | */ |
69 | 69 | protected function sanitize(array $row) |
70 | 70 | { |
71 | - return collect($row)->reject(function ($val, $_) { |
|
71 | + return collect($row)->reject(function($val, $_) { |
|
72 | 72 | |
73 | 73 | return is_array($val) && !Arr::isAssoc($val); |
74 | 74 |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | $attributes = $this->attributes; |
66 | 66 | $attributes['namespace'] = 'Encore\Admin\Controllers'; |
67 | 67 | |
68 | - $this->router->group($attributes, function ($router) { |
|
68 | + $this->router->group($attributes, function($router) { |
|
69 | 69 | |
70 | 70 | $attributes = ['middleware' => 'admin.permission:allow,administrator']; |
71 | 71 | |
72 | - $router->group($attributes, function ($router) { |
|
72 | + $router->group($attributes, function($router) { |
|
73 | 73 | $router->resources([ |
74 | 74 | 'auth/users' => 'UserController', |
75 | 75 | 'auth/roles' => 'RoleController', |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function register() |
94 | 94 | { |
95 | - $this->router->group($this->attributes, function ($router) { |
|
95 | + $this->router->group($this->attributes, function($router) { |
|
96 | 96 | foreach ($this->routes as $method => $arguments) { |
97 | 97 | foreach ($arguments as $argument) { |
98 | 98 | call_user_func_array([$router, $method], $argument); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | if (is_array($permission)) { |
24 | - collect($permission)->each(function ($permission) { |
|
24 | + collect($permission)->each(function($permission) { |
|
25 | 25 | call_user_func([Permission::class, 'check'], $permission); |
26 | 26 | }); |
27 | 27 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | protected static function error() |
76 | 76 | { |
77 | - $content = Admin::content(function ($content) { |
|
77 | + $content = Admin::content(function($content) { |
|
78 | 78 | $content->body(view('admin::deny')); |
79 | 79 | }); |
80 | 80 |
@@ -105,7 +105,7 @@ |
||
105 | 105 | */ |
106 | 106 | protected function decodeUtf8HtmlEntities($html) |
107 | 107 | { |
108 | - return preg_replace_callback('/(&#[0-9]+;)/', function ($html) { |
|
108 | + return preg_replace_callback('/(&#[0-9]+;)/', function($html) { |
|
109 | 109 | return mb_convert_encoding($html[1], 'UTF-8', 'HTML-ENTITIES'); |
110 | 110 | }, $html); |
111 | 111 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | public function button($style = 'default') |
236 | 236 | { |
237 | 237 | if (is_array($style)) { |
238 | - $style = array_map(function ($style) { |
|
238 | + $style = array_map(function($style) { |
|
239 | 239 | return 'btn-'.$style; |
240 | 240 | }, $style); |
241 | 241 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | public function progressBar($style = 'primary', $size = 'sm', $max = 100) |
264 | 264 | { |
265 | 265 | if (is_array($style)) { |
266 | - $style = array_map(function ($style) { |
|
266 | + $style = array_map(function($style) { |
|
267 | 267 | return 'progress-bar-'.$style; |
268 | 268 | }, $style); |
269 | 269 | |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | protected function htmlEntityEncode($item) |
442 | 442 | { |
443 | 443 | if (is_array($item)) { |
444 | - array_walk_recursive($item, function (&$value) { |
|
444 | + array_walk_recursive($item, function(&$value) { |
|
445 | 445 | $value = htmlentities($value); |
446 | 446 | }); |
447 | 447 | } else { |