@@ -236,7 +236,7 @@ |
||
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); |
@@ -75,7 +75,7 @@ |
||
75 | 75 | return ''; |
76 | 76 | } |
77 | 77 | |
78 | - return $this->elements[$part]->map(function ($element) { |
|
78 | + return $this->elements[$part]->map(function($element) { |
|
79 | 79 | if ($element instanceof Htmlable) { |
80 | 80 | return $element->toHtml(); |
81 | 81 | } |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | */ |
301 | 301 | public function setWidth($fieldWidth = 8, $labelWidth = 2) |
302 | 302 | { |
303 | - collect($this->fields)->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
303 | + collect($this->fields)->each(function($field) use ($fieldWidth, $labelWidth) { |
|
304 | 304 | /* @var Field $field */ |
305 | 305 | $field->setWidth($fieldWidth, $labelWidth); |
306 | 306 | }); |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | |
516 | 516 | $field = new $class(Arr::get($arguments, 0), array_slice($arguments, 1)); |
517 | 517 | |
518 | - return tap($field, function ($field) { |
|
518 | + return tap($field, function($field) { |
|
519 | 519 | $this->pushField($field); |
520 | 520 | }); |
521 | 521 | } |
@@ -168,7 +168,7 @@ |
||
168 | 168 | return $this->style([$styles]); |
169 | 169 | } |
170 | 170 | |
171 | - $styles = array_map(function ($style) { |
|
171 | + $styles = array_map(function($style) { |
|
172 | 172 | return 'box-'.$style; |
173 | 173 | }, $styles); |
174 | 174 |
@@ -21,20 +21,20 @@ |
||
21 | 21 | public static function environment() |
22 | 22 | { |
23 | 23 | $envs = [ |
24 | - ['name' => 'PHP version', 'value' => 'PHP/'.PHP_VERSION], |
|
25 | - ['name' => 'Laravel version', 'value' => app()->version()], |
|
26 | - ['name' => 'CGI', 'value' => php_sapi_name()], |
|
27 | - ['name' => 'Uname', 'value' => php_uname()], |
|
28 | - ['name' => 'Server', 'value' => Arr::get($_SERVER, 'SERVER_SOFTWARE')], |
|
24 | + ['name' => 'PHP version', 'value' => 'PHP/'.PHP_VERSION], |
|
25 | + ['name' => 'Laravel version', 'value' => app()->version()], |
|
26 | + ['name' => 'CGI', 'value' => php_sapi_name()], |
|
27 | + ['name' => 'Uname', 'value' => php_uname()], |
|
28 | + ['name' => 'Server', 'value' => Arr::get($_SERVER, 'SERVER_SOFTWARE')], |
|
29 | 29 | |
30 | - ['name' => 'Cache driver', 'value' => config('cache.default')], |
|
31 | - ['name' => 'Session driver', 'value' => config('session.driver')], |
|
32 | - ['name' => 'Queue driver', 'value' => config('queue.default')], |
|
30 | + ['name' => 'Cache driver', 'value' => config('cache.default')], |
|
31 | + ['name' => 'Session driver', 'value' => config('session.driver')], |
|
32 | + ['name' => 'Queue driver', 'value' => config('queue.default')], |
|
33 | 33 | |
34 | - ['name' => 'Timezone', 'value' => config('app.timezone')], |
|
35 | - ['name' => 'Locale', 'value' => config('app.locale')], |
|
36 | - ['name' => 'Env', 'value' => config('app.env')], |
|
37 | - ['name' => 'URL', 'value' => config('app.url')], |
|
34 | + ['name' => 'Timezone', 'value' => config('app.timezone')], |
|
35 | + ['name' => 'Locale', 'value' => config('app.locale')], |
|
36 | + ['name' => 'Env', 'value' => config('app.env')], |
|
37 | + ['name' => 'URL', 'value' => config('app.url')], |
|
38 | 38 | ]; |
39 | 39 | |
40 | 40 | return view('admin::dashboard.environment', compact('envs')); |
@@ -36,14 +36,14 @@ discard block |
||
36 | 36 | $grid->column('created_at', trans('admin.created_at')); |
37 | 37 | $grid->column('updated_at', trans('admin.updated_at')); |
38 | 38 | |
39 | - $grid->actions(function (Grid\Displayers\Actions $actions) { |
|
39 | + $grid->actions(function(Grid\Displayers\Actions $actions) { |
|
40 | 40 | if ($actions->row->slug == 'administrator') { |
41 | 41 | $actions->disableDelete(); |
42 | 42 | } |
43 | 43 | }); |
44 | 44 | |
45 | - $grid->tools(function (Grid\Tools $tools) { |
|
46 | - $tools->batch(function (Grid\Tools\BatchActions $actions) { |
|
45 | + $grid->tools(function(Grid\Tools $tools) { |
|
46 | + $tools->batch(function(Grid\Tools\BatchActions $actions) { |
|
47 | 47 | $actions->disableDelete(); |
48 | 48 | }); |
49 | 49 | }); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $show->field('id', 'ID'); |
68 | 68 | $show->field('slug', trans('admin.slug')); |
69 | 69 | $show->field('name', trans('admin.name')); |
70 | - $show->field('permissions', trans('admin.permissions'))->as(function ($permission) { |
|
70 | + $show->field('permissions', trans('admin.permissions'))->as(function($permission) { |
|
71 | 71 | return $permission->pluck('name'); |
72 | 72 | })->label(); |
73 | 73 | $show->field('created_at', trans('admin.created_at')); |
@@ -27,14 +27,14 @@ discard block |
||
27 | 27 | |
28 | 28 | $grid->column('id', 'ID')->sortable(); |
29 | 29 | $grid->column('user.name', 'User'); |
30 | - $grid->column('method')->display(function ($method) { |
|
30 | + $grid->column('method')->display(function($method) { |
|
31 | 31 | $color = Arr::get(OperationLog::$methodColors, $method, 'grey'); |
32 | 32 | |
33 | 33 | return "<span class=\"badge bg-$color\">$method</span>"; |
34 | 34 | }); |
35 | 35 | $grid->column('path')->label('info'); |
36 | 36 | $grid->column('ip')->label('primary'); |
37 | - $grid->column('input')->display(function ($input) { |
|
37 | + $grid->column('input')->display(function($input) { |
|
38 | 38 | $input = json_decode($input, true); |
39 | 39 | $input = Arr::except($input, ['_pjax', '_token', '_method', '_previous_']); |
40 | 40 | if (empty($input)) { |
@@ -46,14 +46,14 @@ discard block |
||
46 | 46 | |
47 | 47 | $grid->column('created_at', trans('admin.created_at')); |
48 | 48 | |
49 | - $grid->actions(function (Grid\Displayers\Actions $actions) { |
|
49 | + $grid->actions(function(Grid\Displayers\Actions $actions) { |
|
50 | 50 | $actions->disableEdit(); |
51 | 51 | $actions->disableView(); |
52 | 52 | }); |
53 | 53 | |
54 | 54 | $grid->disableCreateButton(); |
55 | 55 | |
56 | - $grid->filter(function (Grid\Filter $filter) { |
|
56 | + $grid->filter(function(Grid\Filter $filter) { |
|
57 | 57 | $userModel = config('admin.database.users_model'); |
58 | 58 | |
59 | 59 | $filter->equal('user_id', 'User')->select($userModel::all()->pluck('name', 'id')); |
@@ -32,8 +32,8 @@ discard block |
||
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 |
||
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(' '); |
49 | 49 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | $grid->column('created_at', trans('admin.created_at')); |
59 | 59 | $grid->column('updated_at', trans('admin.updated_at')); |
60 | 60 | |
61 | - $grid->tools(function (Grid\Tools $tools) { |
|
62 | - $tools->batch(function (Grid\Tools\BatchActions $actions) { |
|
61 | + $grid->tools(function(Grid\Tools $tools) { |
|
62 | + $tools->batch(function(Grid\Tools\BatchActions $actions) { |
|
63 | 63 | $actions->disableDelete(); |
64 | 64 | }); |
65 | 65 | }); |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | $show->field('slug', trans('admin.slug')); |
85 | 85 | $show->field('name', trans('admin.name')); |
86 | 86 | |
87 | - $show->field('http_path', trans('admin.route'))->unescape()->as(function ($path) { |
|
88 | - return collect(explode("\r\n", $path))->map(function ($path) { |
|
87 | + $show->field('http_path', trans('admin.route'))->unescape()->as(function($path) { |
|
88 | + return collect(explode("\r\n", $path))->map(function($path) { |
|
89 | 89 | $method = $this->http_method ?: ['ANY']; |
90 | 90 | |
91 | 91 | if (Str::contains($path, ':')) { |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | $method = explode(',', $method); |
94 | 94 | } |
95 | 95 | |
96 | - $method = collect($method)->map(function ($name) { |
|
96 | + $method = collect($method)->map(function($name) { |
|
97 | 97 | return strtoupper($name); |
98 | - })->map(function ($name) { |
|
98 | + })->map(function($name) { |
|
99 | 99 | return "<span class='label label-primary'>{$name}</span>"; |
100 | 100 | })->implode(' '); |
101 | 101 |
@@ -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')); |