@@ -42,7 +42,7 @@ |
||
42 | 42 | if (empty($selectedOption)) { |
43 | 43 | $selected = $this->choice('Please choose a role for the user', $selectedOption, null, null, true); |
44 | 44 | |
45 | - $roles = $roles->filter(function ($role) use ($selected) { |
|
45 | + $roles = $roles->filter(function($role) use ($selected) { |
|
46 | 46 | return in_array($role->name, $selected); |
47 | 47 | }); |
48 | 48 | } |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | return $ret; |
377 | 377 | } |
378 | 378 | |
379 | - collect(explode(',', $id))->filter()->each(function ($id) { |
|
379 | + collect(explode(',', $id))->filter()->each(function($id) { |
|
380 | 380 | $builder = $this->model()->newQuery(); |
381 | 381 | |
382 | 382 | if ($this->isSoftDeletes) { |
@@ -429,9 +429,9 @@ discard block |
||
429 | 429 | |
430 | 430 | $data = $model->toArray(); |
431 | 431 | |
432 | - $this->builder->fields()->filter(function ($field) { |
|
432 | + $this->builder->fields()->filter(function($field) { |
|
433 | 433 | return $field instanceof Field\File; |
434 | - })->each(function (Field\File $file) use ($data) { |
|
434 | + })->each(function(Field\File $file) use ($data) { |
|
435 | 435 | $file->setOriginal($data); |
436 | 436 | |
437 | 437 | $file->destroy(); |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | return $response; |
457 | 457 | } |
458 | 458 | |
459 | - DB::transaction(function () { |
|
459 | + DB::transaction(function() { |
|
460 | 460 | $inserts = $this->prepareInsert($this->updates); |
461 | 461 | |
462 | 462 | foreach ($inserts as $column => $value) { |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | return $response; |
627 | 627 | } |
628 | 628 | |
629 | - DB::transaction(function () { |
|
629 | + DB::transaction(function() { |
|
630 | 630 | $updates = $this->prepareUpdate($this->updates); |
631 | 631 | |
632 | 632 | foreach ($updates as $column => $value) { |
@@ -1106,7 +1106,7 @@ discard block |
||
1106 | 1106 | protected function getFieldByColumn($column) |
1107 | 1107 | { |
1108 | 1108 | return $this->builder->fields()->first( |
1109 | - function (Field $field) use ($column) { |
|
1109 | + function(Field $field) use ($column) { |
|
1110 | 1110 | if (is_array($field->column())) { |
1111 | 1111 | return in_array($column, $field->column()); |
1112 | 1112 | } |
@@ -1127,7 +1127,7 @@ discard block |
||
1127 | 1127 | |
1128 | 1128 | $values = $this->model->toArray(); |
1129 | 1129 | |
1130 | - $this->builder->fields()->each(function (Field $field) use ($values) { |
|
1130 | + $this->builder->fields()->each(function(Field $field) use ($values) { |
|
1131 | 1131 | $field->setOriginal($values); |
1132 | 1132 | }); |
1133 | 1133 | } |
@@ -1157,7 +1157,7 @@ discard block |
||
1157 | 1157 | |
1158 | 1158 | $data = $this->model->toArray(); |
1159 | 1159 | |
1160 | - $this->builder->fields()->each(function (Field $field) use ($data) { |
|
1160 | + $this->builder->fields()->each(function(Field $field) use ($data) { |
|
1161 | 1161 | if (!in_array($field->column(), $this->ignored, true)) { |
1162 | 1162 | $field->fill($data); |
1163 | 1163 | } |
@@ -1301,7 +1301,7 @@ discard block |
||
1301 | 1301 | */ |
1302 | 1302 | public function setWidth($fieldWidth = 8, $labelWidth = 2): self |
1303 | 1303 | { |
1304 | - $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
1304 | + $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) { |
|
1305 | 1305 | /* @var Field $field */ |
1306 | 1306 | $field->setWidth($fieldWidth, $labelWidth); |
1307 | 1307 | }); |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | */ |
336 | 336 | public function field($name) |
337 | 337 | { |
338 | - return $this->fields()->first(function (Field $field) use ($name) { |
|
338 | + return $this->fields()->first(function(Field $field) use ($name) { |
|
339 | 339 | return $field->column() === $name; |
340 | 340 | }); |
341 | 341 | } |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | |
535 | 535 | $this->form->getLayout()->removeReservedFields($reservedColumns); |
536 | 536 | |
537 | - $this->fields = $this->fields()->reject(function (Field $field) use ($reservedColumns) { |
|
537 | + $this->fields = $this->fields()->reject(function(Field $field) use ($reservedColumns) { |
|
538 | 538 | return in_array($field->column(), $reservedColumns, true); |
539 | 539 | }); |
540 | 540 | } |
@@ -112,7 +112,7 @@ |
||
112 | 112 | */ |
113 | 113 | protected static function bootHasPermissions() |
114 | 114 | { |
115 | - static::deleting(function ($model) { |
|
115 | + static::deleting(function($model) { |
|
116 | 116 | $model->roles()->detach(); |
117 | 117 | |
118 | 118 | $model->permissions()->detach(); |
@@ -34,14 +34,14 @@ discard block |
||
34 | 34 | $grid->column('created_at', trans('admin.created_at')); |
35 | 35 | $grid->column('updated_at', trans('admin.updated_at')); |
36 | 36 | |
37 | - $grid->actions(function (Grid\Displayers\Actions $actions) { |
|
37 | + $grid->actions(function(Grid\Displayers\Actions $actions) { |
|
38 | 38 | if ($actions->getKey() == 1) { |
39 | 39 | $actions->disableDelete(); |
40 | 40 | } |
41 | 41 | }); |
42 | 42 | |
43 | - $grid->tools(function (Grid\Tools $tools) { |
|
44 | - $tools->batch(function (Grid\Tools\BatchActions $actions) { |
|
43 | + $grid->tools(function(Grid\Tools $tools) { |
|
44 | + $tools->batch(function(Grid\Tools\BatchActions $actions) { |
|
45 | 45 | $actions->disableDelete(); |
46 | 46 | }); |
47 | 47 | }); |
@@ -65,15 +65,15 @@ discard block |
||
65 | 65 | $show->field('id', 'ID'); |
66 | 66 | $show->field('username', trans('admin.username')); |
67 | 67 | $show->field('name', trans('admin.name')); |
68 | - $show->field('roles', trans('admin.roles'))->as(function ($roles) { |
|
68 | + $show->field('roles', trans('admin.roles'))->as(function($roles) { |
|
69 | 69 | return $roles->pluck('name'); |
70 | 70 | })->label(); |
71 | - $show->field('permissions', trans('admin.permissions'))->as(function ($permission) { |
|
71 | + $show->field('permissions', trans('admin.permissions'))->as(function($permission) { |
|
72 | 72 | return $permission->pluck('name'); |
73 | 73 | })->label(); |
74 | 74 | $show->field('created_at', trans('admin.created_at')); |
75 | 75 | $show->field('updated_at', trans('admin.updated_at')); |
76 | - $show->panel()->tools(function ($tools) use ($id) { |
|
76 | + $show->panel()->tools(function($tools) use ($id) { |
|
77 | 77 | if ($id == 1) { |
78 | 78 | $tools->disableDelete(); |
79 | 79 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $form->image('avatar', trans('admin.avatar')); |
108 | 108 | $form->password('password', trans('admin.password'))->rules('required|confirmed'); |
109 | 109 | $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required') |
110 | - ->default(function ($form) { |
|
110 | + ->default(function($form) { |
|
111 | 111 | return $form->model()->password; |
112 | 112 | }); |
113 | 113 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $form->display('created_at', trans('admin.created_at')); |
120 | 120 | $form->display('updated_at', trans('admin.updated_at')); |
121 | 121 | |
122 | - $form->saving(function (Form $form) { |
|
122 | + $form->saving(function(Form $form) { |
|
123 | 123 | if ($form->password && $form->model()->password != $form->password) { |
124 | 124 | $form->password = bcrypt($form->password); |
125 | 125 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | protected function overWrite() |
159 | 159 | { |
160 | - $this->overWrite= true; |
|
160 | + $this->overWrite = true; |
|
161 | 161 | |
162 | 162 | return $this; |
163 | 163 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $this->overwriteExistingField($name); |
244 | 244 | } |
245 | 245 | |
246 | - return tap($field, function ($field) { |
|
246 | + return tap($field, function($field) { |
|
247 | 247 | $this->fields->push($field); |
248 | 248 | }); |
249 | 249 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $this->overwriteExistingRelation($name); |
268 | 268 | } |
269 | 269 | |
270 | - return tap($relation, function ($relation) { |
|
270 | + return tap($relation, function($relation) { |
|
271 | 271 | $this->relations->push($relation); |
272 | 272 | }); |
273 | 273 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | } |
285 | 285 | |
286 | 286 | $this->fields = $this->fields->filter( |
287 | - function (Field $field) use ($name) { |
|
287 | + function(Field $field) use ($name) { |
|
288 | 288 | return $field->getName() != $name; |
289 | 289 | } |
290 | 290 | ); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | } |
303 | 303 | |
304 | 304 | $this->relations = $this->relations->filter( |
305 | - function (Relation $relation) use ($name) { |
|
305 | + function(Relation $relation) use ($name) { |
|
306 | 306 | return $relation->getName() != $name; |
307 | 307 | } |
308 | 308 | ); |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | */ |
360 | 360 | public function setWidth($fieldWidth = 8, $labelWidth = 2) |
361 | 361 | { |
362 | - collect($this->fields)->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
362 | + collect($this->fields)->each(function($field) use ($fieldWidth, $labelWidth) { |
|
363 | 363 | $field->each->setWidth($fieldWidth, $labelWidth); |
364 | 364 | }); |
365 | 365 |