Completed
Pull Request — master (#4216)
by jxlwqq
02:30
created
src/Form.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         });
Please login to merge, or discard this patch.
src/Form/Builder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Auth/Database/HasPermissions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/Controllers/PermissionController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
         $grid->column('slug', trans('admin.slug'));
33 33
         $grid->column('name', trans('admin.name'));
34 34
 
35
-        $grid->column('http_path', trans('admin.route'))->display(function ($path) {
36
-            return collect(explode("\n", $path))->map(function ($path) {
35
+        $grid->column('http_path', trans('admin.route'))->display(function($path) {
36
+            return collect(explode("\n", $path))->map(function($path) {
37 37
                 $method = $this->http_method ?: ['ANY'];
38 38
 
39 39
                 if (Str::contains($path, ':')) {
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
                     $method = explode(',', $method);
42 42
                 }
43 43
 
44
-                $method = collect($method)->map(function ($name) {
44
+                $method = collect($method)->map(function($name) {
45 45
                     return strtoupper($name);
46
-                })->map(function ($name) {
46
+                })->map(function($name) {
47 47
                     return "<span class='label label-primary'>{$name}</span>";
48 48
                 })->implode('&nbsp;');
49 49
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             })->implode('');
56 56
         });
57 57
         
58
-        $grid->filter(function (Grid\Filter $filter) {
58
+        $grid->filter(function(Grid\Filter $filter) {
59 59
             $filter->like('slug', trans('admin.slug'));
60 60
             $filter->like('name', trans('admin.name'));
61 61
             $filter->like('http_path', trans('admin.route'));
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
         $grid->column('created_at', trans('admin.created_at'));
65 65
         $grid->column('updated_at', trans('admin.updated_at'));
66 66
 
67
-        $grid->tools(function (Grid\Tools $tools) {
68
-            $tools->batch(function (Grid\Tools\BatchActions $actions) {
67
+        $grid->tools(function(Grid\Tools $tools) {
68
+            $tools->batch(function(Grid\Tools\BatchActions $actions) {
69 69
                 $actions->disableDelete();
70 70
             });
71 71
         });
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
         $show->field('slug', trans('admin.slug'));
91 91
         $show->field('name', trans('admin.name'));
92 92
 
93
-        $show->field('http_path', trans('admin.route'))->unescape()->as(function ($path) {
94
-            return collect(explode("\r\n", $path))->map(function ($path) {
93
+        $show->field('http_path', trans('admin.route'))->unescape()->as(function($path) {
94
+            return collect(explode("\r\n", $path))->map(function($path) {
95 95
                 $method = $this->http_method ?: ['ANY'];
96 96
 
97 97
                 if (Str::contains($path, ':')) {
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
                     $method = explode(',', $method);
100 100
                 }
101 101
 
102
-                $method = collect($method)->map(function ($name) {
102
+                $method = collect($method)->map(function($name) {
103 103
                     return strtoupper($name);
104
-                })->map(function ($name) {
104
+                })->map(function($name) {
105 105
                     return "<span class='label label-primary'>{$name}</span>";
106 106
                 })->implode('&nbsp;');
107 107
 
Please login to merge, or discard this patch.
src/Controllers/UserController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,25 +34,25 @@  discard block
 block discarded – undo
34 34
         $grid->column('created_at', trans('admin.created_at'));
35 35
         $grid->column('updated_at', trans('admin.updated_at'));
36 36
         
37
-        $grid->filter(function (Grid\Filter $filter) {
37
+        $grid->filter(function(Grid\Filter $filter) {
38 38
             $roleModel = config('admin.database.roles_model');
39 39
             $filter->like('username', trans('admin.username'));
40 40
             $filter->like('name', trans('admin.name'));
41
-            $filter->where(function ($query) {
42
-                $query->whereHas('roles', function ($query) {
41
+            $filter->where(function($query) {
42
+                $query->whereHas('roles', function($query) {
43 43
                     $query->where('id', $this->input);
44 44
                 });
45 45
             }, trans('admin.roles'))->select($roleModel::all()->pluck('name', 'id'));
46 46
         });
47 47
 
48
-        $grid->actions(function (Grid\Displayers\Actions $actions) {
48
+        $grid->actions(function(Grid\Displayers\Actions $actions) {
49 49
             if ($actions->getKey() == 1) {
50 50
                 $actions->disableDelete();
51 51
             }
52 52
         });
53 53
 
54
-        $grid->tools(function (Grid\Tools $tools) {
55
-            $tools->batch(function (Grid\Tools\BatchActions $actions) {
54
+        $grid->tools(function(Grid\Tools $tools) {
55
+            $tools->batch(function(Grid\Tools\BatchActions $actions) {
56 56
                 $actions->disableDelete();
57 57
             });
58 58
         });
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
         $show->field('id', 'ID');
77 77
         $show->field('username', trans('admin.username'));
78 78
         $show->field('name', trans('admin.name'));
79
-        $show->field('roles', trans('admin.roles'))->as(function ($roles) {
79
+        $show->field('roles', trans('admin.roles'))->as(function($roles) {
80 80
             return $roles->pluck('name');
81 81
         })->label();
82
-        $show->field('permissions', trans('admin.permissions'))->as(function ($permission) {
82
+        $show->field('permissions', trans('admin.permissions'))->as(function($permission) {
83 83
             return $permission->pluck('name');
84 84
         })->label();
85 85
         $show->field('created_at', trans('admin.created_at'));
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $form->image('avatar', trans('admin.avatar'));
114 114
         $form->password('password', trans('admin.password'))->rules('required|confirmed');
115 115
         $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required')
116
-            ->default(function ($form) {
116
+            ->default(function($form) {
117 117
                 return $form->model()->password;
118 118
             });
119 119
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $form->display('created_at', trans('admin.created_at'));
126 126
         $form->display('updated_at', trans('admin.updated_at'));
127 127
 
128
-        $form->saving(function (Form $form) {
128
+        $form->saving(function(Form $form) {
129 129
             if ($form->password && $form->model()->password != $form->password) {
130 130
                 $form->password = bcrypt($form->password);
131 131
             }
Please login to merge, or discard this patch.
src/Controllers/RoleController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -36,25 +36,25 @@  discard block
 block discarded – undo
36 36
         $grid->column('created_at', trans('admin.created_at'));
37 37
         $grid->column('updated_at', trans('admin.updated_at'));
38 38
         
39
-        $grid->filter(function (Grid\Filter $filter) {
39
+        $grid->filter(function(Grid\Filter $filter) {
40 40
             $permissionModel = config('admin.database.permissions_model');
41 41
             $filter->like('slug', __('admin.slug'));
42 42
             $filter->like('name', __('admin.name'));
43
-            $filter->where(function ($query) {
43
+            $filter->where(function($query) {
44 44
                 $query->whereHas('permissions', function($query) {
45 45
                     $query->where('id', $this->input);
46 46
                 });
47 47
             }, __('admin.permissions'))->select($permissionModel::all()->pluck('name', 'id'));
48 48
         });
49 49
 
50
-        $grid->actions(function (Grid\Displayers\Actions $actions) {
50
+        $grid->actions(function(Grid\Displayers\Actions $actions) {
51 51
             if ($actions->row->slug == 'administrator') {
52 52
                 $actions->disableDelete();
53 53
             }
54 54
         });
55 55
 
56
-        $grid->tools(function (Grid\Tools $tools) {
57
-            $tools->batch(function (Grid\Tools\BatchActions $actions) {
56
+        $grid->tools(function(Grid\Tools $tools) {
57
+            $tools->batch(function(Grid\Tools\BatchActions $actions) {
58 58
                 $actions->disableDelete();
59 59
             });
60 60
         });
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $show->field('id', 'ID');
79 79
         $show->field('slug', trans('admin.slug'));
80 80
         $show->field('name', trans('admin.name'));
81
-        $show->field('permissions', trans('admin.permissions'))->as(function ($permission) {
81
+        $show->field('permissions', trans('admin.permissions'))->as(function($permission) {
82 82
             return $permission->pluck('name');
83 83
         })->label();
84 84
         $show->field('created_at', trans('admin.created_at'));
Please login to merge, or discard this patch.