Completed
Pull Request — master (#4216)
by jxlwqq
02:30
created
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.