@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | return $next($request); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if (!Admin::user()->allPermissions()->first(function ($permission) use ($request) { |
|
| 36 | + if (!Admin::user()->allPermissions()->first(function($permission) use ($request) { |
|
| 37 | 37 | return $permission->shouldPassThrough($request); |
| 38 | 38 | })) { |
| 39 | 39 | Checker::error(); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function checkRoutePermission(Request $request) |
| 54 | 54 | { |
| 55 | - if (!$middleware = collect($request->route()->middleware())->first(function ($middleware) { |
|
| 55 | + if (!$middleware = collect($request->route()->middleware())->first(function($middleware) { |
|
| 56 | 56 | return Str::startsWith($middleware, $this->middlewarePrefix); |
| 57 | 57 | })) { |
| 58 | 58 | return false; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | return collect($excepts) |
| 89 | 89 | ->map('admin_base_path') |
| 90 | - ->contains(function ($except) use ($request) { |
|
| 90 | + ->contains(function($except) use ($request) { |
|
| 91 | 91 | if ($except !== '/') { |
| 92 | 92 | $except = trim($except, '/'); |
| 93 | 93 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | |
| 44 | 44 | return collect($excepts) |
| 45 | 45 | ->map('admin_base_path') |
| 46 | - ->contains(function ($except) use ($request) { |
|
| 46 | + ->contains(function($except) use ($request) { |
|
| 47 | 47 | if ($except !== '/') { |
| 48 | 48 | $except = trim($except, '/'); |
| 49 | 49 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | |
| 50 | 50 | $eagerLoads = array_keys($this->getQuery()->getEagerLoads()); |
| 51 | 51 | |
| 52 | - $columns = collect($columns)->reject(function ($column) use ($eagerLoads) { |
|
| 52 | + $columns = collect($columns)->reject(function($column) use ($eagerLoads) { |
|
| 53 | 53 | return Str::contains($column, '.') || in_array($column, $eagerLoads); |
| 54 | 54 | }); |
| 55 | 55 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $columns = $titles; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - $data = array_map(function ($item) use ($columns) { |
|
| 26 | + $data = array_map(function($item) use ($columns) { |
|
| 27 | 27 | $sorted = []; |
| 28 | 28 | |
| 29 | 29 | $arr = Arr::only($item, $columns); |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | |
| 66 | 66 | $this->value = Arr::get($inputs, $this->column); |
| 67 | 67 | |
| 68 | - $value = array_filter($this->value, function ($val) { |
|
| 68 | + $value = array_filter($this->value, function($val) { |
|
| 69 | 69 | return $val !== ''; |
| 70 | 70 | }); |
| 71 | 71 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | { |
| 198 | 198 | static::$branchOrder = array_flip(Arr::flatten($order)); |
| 199 | 199 | |
| 200 | - static::$branchOrder = array_map(function ($item) { |
|
| 200 | + static::$branchOrder = array_map(function($item) { |
|
| 201 | 201 | return ++$item; |
| 202 | 202 | }, static::$branchOrder); |
| 203 | 203 | } |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | { |
| 295 | 295 | parent::boot(); |
| 296 | 296 | |
| 297 | - static::saving(function (Model $branch) { |
|
| 297 | + static::saving(function(Model $branch) { |
|
| 298 | 298 | $parentColumn = $branch->getParentColumn(); |
| 299 | 299 | |
| 300 | 300 | if (Request::has($parentColumn) && Request::input($parentColumn) == $branch->getKey()) { |
@@ -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')); |
@@ -65,9 +65,9 @@ |
||
| 65 | 65 | |
| 66 | 66 | $prepare = $form->prepare($input); |
| 67 | 67 | |
| 68 | - return collect($prepare)->reject(function ($item) { |
|
| 68 | + return collect($prepare)->reject(function($item) { |
|
| 69 | 69 | return $item[NestedForm::REMOVE_FLAG_NAME] == 1; |
| 70 | - })->map(function ($item) { |
|
| 70 | + })->map(function($item) { |
|
| 71 | 71 | unset($item[NestedForm::REMOVE_FLAG_NAME]); |
| 72 | 72 | |
| 73 | 73 | return $item; |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | * |
| 437 | 437 | * @param array $data |
| 438 | 438 | * |
| 439 | - * @return mixed |
|
| 439 | + * @return Response|null |
|
| 440 | 440 | */ |
| 441 | 441 | protected function prepare($data = []) |
| 442 | 442 | { |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | /** |
| 577 | 577 | * Get RedirectResponse after update. |
| 578 | 578 | * |
| 579 | - * @param mixed $key |
|
| 579 | + * @param integer $key |
|
| 580 | 580 | * |
| 581 | 581 | * @return \Illuminate\Http\RedirectResponse |
| 582 | 582 | */ |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | return $ret; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | - collect(explode(',', $id))->filter()->each(function ($id) { |
|
| 254 | + collect(explode(',', $id))->filter()->each(function($id) { |
|
| 255 | 255 | $builder = $this->model()->newQuery(); |
| 256 | 256 | |
| 257 | 257 | if ($this->isSoftDeletes) { |
@@ -304,9 +304,9 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | $data = $model->toArray(); |
| 306 | 306 | |
| 307 | - $this->fields()->filter(function ($field) { |
|
| 307 | + $this->fields()->filter(function($field) { |
|
| 308 | 308 | return $field instanceof Field\File; |
| 309 | - })->each(function (Field\File $file) use ($data) { |
|
| 309 | + })->each(function(Field\File $file) use ($data) { |
|
| 310 | 310 | $file->setOriginal($data); |
| 311 | 311 | |
| 312 | 312 | $file->destroy(); |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | return $response; |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | - DB::transaction(function () { |
|
| 334 | + DB::transaction(function() { |
|
| 335 | 335 | $inserts = $this->prepareInsert($this->updates); |
| 336 | 336 | |
| 337 | 337 | foreach ($inserts as $column => $value) { |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | return $response; |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | - DB::transaction(function () { |
|
| 536 | + DB::transaction(function() { |
|
| 537 | 537 | $updates = $this->prepareUpdate($this->updates); |
| 538 | 538 | |
| 539 | 539 | foreach ($updates as $column => $value) { |
@@ -985,7 +985,7 @@ discard block |
||
| 985 | 985 | protected function getFieldByColumn($column) |
| 986 | 986 | { |
| 987 | 987 | return $this->fields()->first( |
| 988 | - function (Field $field) use ($column) { |
|
| 988 | + function(Field $field) use ($column) { |
|
| 989 | 989 | if (is_array($field->column())) { |
| 990 | 990 | return in_array($column, $field->column()); |
| 991 | 991 | } |
@@ -1004,7 +1004,7 @@ discard block |
||
| 1004 | 1004 | { |
| 1005 | 1005 | $values = $this->model->toArray(); |
| 1006 | 1006 | |
| 1007 | - $this->fields()->each(function (Field $field) use ($values) { |
|
| 1007 | + $this->fields()->each(function(Field $field) use ($values) { |
|
| 1008 | 1008 | $field->setOriginal($values); |
| 1009 | 1009 | }); |
| 1010 | 1010 | } |
@@ -1032,7 +1032,7 @@ discard block |
||
| 1032 | 1032 | |
| 1033 | 1033 | $data = $this->model->toArray(); |
| 1034 | 1034 | |
| 1035 | - $this->fields()->each(function (Field $field) use ($data) { |
|
| 1035 | + $this->fields()->each(function(Field $field) use ($data) { |
|
| 1036 | 1036 | if (!in_array($field->column(), $this->ignored, true)) { |
| 1037 | 1037 | $field->fill($data); |
| 1038 | 1038 | } |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | */ |
| 1163 | 1163 | public function setWidth($fieldWidth = 8, $labelWidth = 2): self |
| 1164 | 1164 | { |
| 1165 | - $this->fields()->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
| 1165 | + $this->fields()->each(function($field) use ($fieldWidth, $labelWidth) { |
|
| 1166 | 1166 | /* @var Field $field */ |
| 1167 | 1167 | $field->setWidth($fieldWidth, $labelWidth); |
| 1168 | 1168 | }); |
@@ -18,7 +18,6 @@ |
||
| 18 | 18 | use Illuminate\Database\Eloquent\Model; |
| 19 | 19 | use Illuminate\Database\Eloquent\Relations; |
| 20 | 20 | use Illuminate\Database\Eloquent\SoftDeletes; |
| 21 | -use Illuminate\Http\Request; |
|
| 22 | 21 | use Illuminate\Support\Arr; |
| 23 | 22 | use Illuminate\Support\Facades\DB; |
| 24 | 23 | use Illuminate\Support\MessageBag; |