@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | return $ret; |
378 | 378 | } |
379 | 379 | |
380 | - collect(explode(',', $id))->filter()->each(function ($id) { |
|
380 | + collect(explode(',', $id))->filter()->each(function($id) { |
|
381 | 381 | $builder = $this->model()->newQuery(); |
382 | 382 | |
383 | 383 | if ($this->isSoftDeletes) { |
@@ -430,9 +430,9 @@ discard block |
||
430 | 430 | |
431 | 431 | $data = $model->toArray(); |
432 | 432 | |
433 | - $this->builder->fields()->filter(function ($field) { |
|
433 | + $this->builder->fields()->filter(function($field) { |
|
434 | 434 | return $field instanceof Field\File; |
435 | - })->each(function (Field\File $file) use ($data) { |
|
435 | + })->each(function(Field\File $file) use ($data) { |
|
436 | 436 | $file->setOriginal($data); |
437 | 437 | |
438 | 438 | $file->destroy(); |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | return $response; |
458 | 458 | } |
459 | 459 | |
460 | - DB::transaction(function () { |
|
460 | + DB::transaction(function() { |
|
461 | 461 | $inserts = $this->prepareInsert($this->updates); |
462 | 462 | |
463 | 463 | foreach ($inserts as $column => $value) { |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | return $response; |
626 | 626 | } |
627 | 627 | |
628 | - DB::transaction(function () { |
|
628 | + DB::transaction(function() { |
|
629 | 629 | $updates = $this->prepareUpdate($this->updates); |
630 | 630 | |
631 | 631 | foreach ($updates as $column => $value) { |
@@ -1105,7 +1105,7 @@ discard block |
||
1105 | 1105 | protected function getFieldByColumn($column) |
1106 | 1106 | { |
1107 | 1107 | return $this->builder->fields()->first( |
1108 | - function (Field $field) use ($column) { |
|
1108 | + function(Field $field) use ($column) { |
|
1109 | 1109 | if (is_array($field->column())) { |
1110 | 1110 | return in_array($column, $field->column()); |
1111 | 1111 | } |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | { |
1125 | 1125 | $values = $this->model->toArray(); |
1126 | 1126 | |
1127 | - $this->builder->fields()->each(function (Field $field) use ($values) { |
|
1127 | + $this->builder->fields()->each(function(Field $field) use ($values) { |
|
1128 | 1128 | $field->setOriginal($values); |
1129 | 1129 | }); |
1130 | 1130 | } |
@@ -1152,7 +1152,7 @@ discard block |
||
1152 | 1152 | |
1153 | 1153 | $data = $this->model->toArray(); |
1154 | 1154 | |
1155 | - $this->builder->fields()->each(function (Field $field) use ($data) { |
|
1155 | + $this->builder->fields()->each(function(Field $field) use ($data) { |
|
1156 | 1156 | if (!in_array($field->column(), $this->ignored, true)) { |
1157 | 1157 | $field->fill($data); |
1158 | 1158 | } |
@@ -1282,7 +1282,7 @@ discard block |
||
1282 | 1282 | */ |
1283 | 1283 | public function setWidth($fieldWidth = 8, $labelWidth = 2): self |
1284 | 1284 | { |
1285 | - $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
1285 | + $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) { |
|
1286 | 1286 | /* @var Field $field */ |
1287 | 1287 | $field->setWidth($fieldWidth, $labelWidth); |
1288 | 1288 | }); |
@@ -475,7 +475,7 @@ |
||
475 | 475 | $relation = substr($this->column, 0, strrpos($this->column, '.')); |
476 | 476 | $args[0] = last(explode('.', $this->column)); |
477 | 477 | |
478 | - return ['whereHas' => [$relation, function ($relation) use ($args) { |
|
478 | + return ['whereHas' => [$relation, function($relation) use ($args) { |
|
479 | 479 | call_user_func_array([$relation, $this->query], $args); |
480 | 480 | }]]; |
481 | 481 | } |
@@ -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 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | $tree->disableCreate(); |
77 | 77 | |
78 | - $tree->branch(function ($branch) { |
|
78 | + $tree->branch(function($branch) { |
|
79 | 79 | $payload = "<i class='fa {$branch['icon']}'></i> <strong>{$branch['title']}</strong>"; |
80 | 80 | |
81 | 81 | if (!isset($branch['children'])) { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function handle() |
50 | 50 | { |
51 | - $routes = collect($this->router->getRoutes())->filter(function (Route $route) { |
|
51 | + $routes = collect($this->router->getRoutes())->filter(function(Route $route) { |
|
52 | 52 | $uri = $route->uri(); |
53 | 53 | // built-in, parameterized and no-GET are ignored |
54 | 54 | return Str::startsWith($uri, 'admin/') |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | && !Str::contains($uri, '{') |
58 | 58 | && in_array('GET', $route->methods()); |
59 | 59 | }) |
60 | - ->map(function (Route $route) { |
|
60 | + ->map(function(Route $route) { |
|
61 | 61 | $uri = substr($route->uri(), strlen('admin/')); |
62 | 62 | |
63 | 63 | return [ |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | $menus = Menu::all()->pluck('title', 'uri'); |
73 | 73 | // exclude exist ones |
74 | - $news = $routes->diffKeys($menus)->map(function ($item, $key) { |
|
74 | + $news = $routes->diffKeys($menus)->map(function($item, $key) { |
|
75 | 75 | return [ |
76 | 76 | 'title' => $item, |
77 | 77 | 'uri' => $key, |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } else { |
86 | 86 | if ($this->hasOption('dry-run') && $this->option('dry-run')) { |
87 | 87 | $this->line('<info>The following menu items will be created</info>: '); |
88 | - $this->table(['Title', 'Uri'], array_map(function ($item) { |
|
88 | + $this->table(['Title', 'Uri'], array_map(function($item) { |
|
89 | 89 | return [ |
90 | 90 | $item['title'], |
91 | 91 | $item['uri'], |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | |
155 | 155 | // for create or update |
156 | 156 | if ($this->pathColumn) { |
157 | - $targets = array_map(function ($target) { |
|
157 | + $targets = array_map(function($target) { |
|
158 | 158 | return [$this->pathColumn => $target]; |
159 | 159 | }, $targets); |
160 | 160 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | { |
186 | 186 | $this->name = $this->getStoreName($file); |
187 | 187 | |
188 | - return tap($this->upload($file), function () { |
|
188 | + return tap($this->upload($file), function() { |
|
189 | 189 | $this->name = null; |
190 | 190 | }); |
191 | 191 | } |
@@ -139,16 +139,16 @@ discard block |
||
139 | 139 | call_user_func($this->callback, $this); |
140 | 140 | } |
141 | 141 | |
142 | - $response = function () { |
|
142 | + $response = function() { |
|
143 | 143 | $handle = fopen('php://output', 'w'); |
144 | 144 | $titles = []; |
145 | 145 | |
146 | - $this->chunk(function ($collection) use ($handle, &$titles) { |
|
146 | + $this->chunk(function($collection) use ($handle, &$titles) { |
|
147 | 147 | Column::setOriginalGridModels($collection); |
148 | 148 | |
149 | 149 | $original = $current = $collection->toArray(); |
150 | 150 | |
151 | - $this->grid->getColumns()->map(function (Column $column) use (&$current) { |
|
151 | + $this->grid->getColumns()->map(function(Column $column) use (&$current) { |
|
152 | 152 | $current = $column->fill($current); |
153 | 153 | $this->grid->columnNames[] = $column->getName(); |
154 | 154 | }); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | protected function getVisiableTitles() |
178 | 178 | { |
179 | 179 | $titles = $this->grid->visibleColumns() |
180 | - ->mapWithKeys(function (Column $column) { |
|
180 | + ->mapWithKeys(function(Column $column) { |
|
181 | 181 | return [$column->getName() => $column->getLabel()]; |
182 | 182 | }); |
183 | 183 |