@@ -67,7 +67,7 @@ |
||
67 | 67 | { |
68 | 68 | Admin::script($this->script()); |
69 | 69 | |
70 | - $options = $this->getOptions()->map(function ($option) { |
|
70 | + $options = $this->getOptions()->map(function($option) { |
|
71 | 71 | $selected = ($option == $this->perPage) ? 'selected' : ''; |
72 | 72 | $url = \request()->fullUrlWithQuery([$this->perPageName => $option]); |
73 | 73 |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | $form = $this->settingForm(); |
97 | 97 | $form->tools( |
98 | - function (Form\Tools $tools) { |
|
98 | + function(Form\Tools $tools) { |
|
99 | 99 | $tools->disableList(); |
100 | 100 | $tools->disableDelete(); |
101 | 101 | $tools->disableView(); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $form->image('avatar', trans('admin.avatar')); |
134 | 134 | $form->password('password', trans('admin.password'))->rules('confirmed|required'); |
135 | 135 | $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required') |
136 | - ->default(function ($form) { |
|
136 | + ->default(function($form) { |
|
137 | 137 | return $form->model()->password; |
138 | 138 | }); |
139 | 139 | |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | |
142 | 142 | $form->ignore(['password_confirmation']); |
143 | 143 | |
144 | - $form->saving(function (Form $form) { |
|
144 | + $form->saving(function(Form $form) { |
|
145 | 145 | if ($form->password && $form->model()->password != $form->password) { |
146 | 146 | $form->password = bcrypt($form->password); |
147 | 147 | } |
148 | 148 | }); |
149 | 149 | |
150 | - $form->saved(function () { |
|
150 | + $form->saved(function() { |
|
151 | 151 | admin_toastr(trans('admin.update_succeeded')); |
152 | 152 | |
153 | 153 | return redirect(admin_url('auth/setting')); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $this->value = $this->value->toArray(); |
14 | 14 | } |
15 | 15 | |
16 | - return collect((array) $this->value)->map(function ($item) use ($style) { |
|
16 | + return collect((array) $this->value)->map(function($item) use ($style) { |
|
17 | 17 | if (is_array($style)) { |
18 | 18 | if (is_string($this->getColumn()->getOriginal()) || is_int($this->getColumn()->getOriginal())) { |
19 | 19 | $style = Arr::get($style, $this->getColumn()->getOriginal(), 'success'); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | public function removeFields($fields) |
50 | 50 | { |
51 | - $this->fields = $this->fields->reject(function (Field $field) use ($fields) { |
|
51 | + $this->fields = $this->fields->reject(function(Field $field) use ($fields) { |
|
52 | 52 | return in_array($field->column(), $fields); |
53 | 53 | }); |
54 | 54 | } |
@@ -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 | } |
@@ -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 | } |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | 'Content-Disposition' => "attachment; filename=\"$filename\"", |
23 | 23 | ]; |
24 | 24 | |
25 | - response()->stream(function () { |
|
25 | + response()->stream(function() { |
|
26 | 26 | $handle = fopen('php://output', 'w'); |
27 | 27 | |
28 | 28 | $titles = []; |
29 | 29 | |
30 | - $this->chunk(function ($records) use ($handle, &$titles) { |
|
30 | + $this->chunk(function($records) use ($handle, &$titles) { |
|
31 | 31 | if (empty($titles)) { |
32 | 32 | $titles = $this->getHeaderRowFromRecords($records); |
33 | 33 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | public function getHeaderRowFromRecords(Collection $records): array |
56 | 56 | { |
57 | 57 | $titles = collect(Arr::dot($records->first()->getAttributes()))->keys()->map( |
58 | - function ($key) { |
|
58 | + function($key) { |
|
59 | 59 | $key = str_replace('.', ' ', $key); |
60 | 60 | |
61 | 61 | return Str::ucfirst($key); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | $class = get_called_class(); |
94 | 94 | |
95 | - if (! isset(self::$instance[$class]) || ! self::$instance[$class] instanceof $class) { |
|
95 | + if (!isset(self::$instance[$class]) || !self::$instance[$class] instanceof $class) { |
|
96 | 96 | self::$instance[$class] = new static(); |
97 | 97 | } |
98 | 98 | |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | return false; |
113 | 113 | } |
114 | 114 | |
115 | - if (! empty($css = $extension->css())) { |
|
115 | + if (!empty($css = $extension->css())) { |
|
116 | 116 | Admin::css($css); |
117 | 117 | } |
118 | 118 | |
119 | - if (! empty($js = $extension->js())) { |
|
119 | + if (!empty($js = $extension->js())) { |
|
120 | 120 | Admin::js($js); |
121 | 121 | } |
122 | 122 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function disabled() |
208 | 208 | { |
209 | - return ! $this->enabled(); |
|
209 | + return !$this->enabled(); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | public static function import() |
237 | 237 | { |
238 | 238 | $extension = static::getInstance(); |
239 | - DB::transaction(function () use ($extension) { |
|
239 | + DB::transaction(function() use ($extension) { |
|
240 | 240 | if ($menu = $extension->menu()) { |
241 | 241 | if ($extension->validateMenu($menu)) { |
242 | 242 | extract($menu); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | */ |
310 | 310 | public function validatePermission(array $permission) |
311 | 311 | { |
312 | - if (! empty($permission['method'])) { |
|
312 | + if (!empty($permission['method'])) { |
|
313 | 313 | $permission['method'] = array_map('strtoupper', $permission['method']); |
314 | 314 | } |
315 | 315 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | 'icon' => $icon, |
371 | 371 | 'uri' => $uri, |
372 | 372 | ]); |
373 | - if (! empty($children)) { |
|
373 | + if (!empty($children)) { |
|
374 | 374 | $extension = static::getInstance(); |
375 | 375 | foreach ($children as $child) { |
376 | 376 | if ($extension->validateMenu($child)) { |
@@ -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'])) { |