@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | $this->bootEssentials(); |
| 95 | 95 | |
| 96 | - if (! $this->app->make(AdminEnvironment::class)->check(request())) { |
|
| 96 | + if (!$this->app->make(AdminEnvironment::class)->check(request())) { |
|
| 97 | 97 | return; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | 'role' => Role::class, |
| 163 | 163 | ]; |
| 164 | 164 | |
| 165 | - Auth::provider('chief-eloquent', function ($app, array $config) { |
|
| 165 | + Auth::provider('chief-eloquent', function($app, array $config) { |
|
| 166 | 166 | return new ChiefUserProvider($app['hash'], $config['model']); |
| 167 | 167 | }); |
| 168 | 168 | } |
@@ -226,11 +226,11 @@ discard block |
||
| 226 | 226 | (new ConsoleServiceProvider($this->app))->register(); |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - $this->app->singleton(Registry::class, function () { |
|
| 229 | + $this->app->singleton(Registry::class, function() { |
|
| 230 | 230 | return new Registry([]); |
| 231 | 231 | }); |
| 232 | 232 | |
| 233 | - $this->app->singleton(Settings::class, function () { |
|
| 233 | + $this->app->singleton(Settings::class, function() { |
|
| 234 | 234 | return new Settings; |
| 235 | 235 | }); |
| 236 | 236 | |
@@ -245,13 +245,13 @@ discard block |
||
| 245 | 245 | if ($this->app->make(AdminEnvironment::class)->check(request())) { |
| 246 | 246 | $this->app->when(SettingsController::class) |
| 247 | 247 | ->needs(SettingFields::class) |
| 248 | - ->give(function () { |
|
| 248 | + ->give(function() { |
|
| 249 | 249 | return new SettingFields(new Settings); |
| 250 | 250 | }); |
| 251 | 251 | Relation::morphMap(['chiefuser' => User::class]); |
| 252 | 252 | |
| 253 | 253 | // Global chief nav singleton |
| 254 | - $this->app->singleton(Nav::class, function () { |
|
| 254 | + $this->app->singleton(Nav::class, function() { |
|
| 255 | 255 | return new Nav; |
| 256 | 256 | }); |
| 257 | 257 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | $models = $class::withoutGlobalScopes()->get(); |
| 27 | 27 | |
| 28 | - $models->each(function ($model) use ($fieldKey) { |
|
| 28 | + $models->each(function($model) use ($fieldKey) { |
|
| 29 | 29 | $this->localizeRepeatField($model, $fieldKey); |
| 30 | 30 | }); |
| 31 | 31 | |
@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $value = $model->dynamic($fieldKey); |
| 39 | 39 | |
| 40 | - if (! isset($value)) { |
|
| 40 | + if (!isset($value)) { |
|
| 41 | 41 | $this->warn('Model ['.$model::class.' '.$model->id.'] does not have a ['.$fieldKey.'] field.'); |
| 42 | 42 | |
| 43 | 43 | return; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if (! is_array($value) || empty($value)) { |
|
| 46 | + if (!is_array($value) || empty($value)) { |
|
| 47 | 47 | $this->warn('Model ['.$model::class.' '.$model->id.'] does not have a ['.$fieldKey.'] field that is an array.'); |
| 48 | 48 | |
| 49 | 49 | return; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | $keys = array_keys($value); |
| 53 | 53 | |
| 54 | - if (! is_int($keys[0])) { |
|
| 54 | + if (!is_int($keys[0])) { |
|
| 55 | 55 | $this->info('Model ['.$model::class.' '.$model->id.'] is already a converted ['.$fieldKey.'] field.'); |
| 56 | 56 | |
| 57 | 57 | return; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $entry = []; |
| 88 | 88 | |
| 89 | 89 | foreach ($item as $property => $translations) { |
| 90 | - if (! is_array($translations)) { |
|
| 90 | + if (!is_array($translations)) { |
|
| 91 | 91 | $entry[$property] = $translations; |
| 92 | 92 | |
| 93 | 93 | continue; |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | private function shouldRenderChiefException(Throwable $exception): bool |
| 64 | 64 | { |
| 65 | - return Str::startsWith(request()->path(), 'admin/') && ! $exception instanceof AuthenticationException && ! $exception instanceof ValidationException; |
|
| 65 | + return Str::startsWith(request()->path(), 'admin/') && !$exception instanceof AuthenticationException && !$exception instanceof ValidationException; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | protected function renderChiefException(Request $request, Throwable $exception) |
| 69 | 69 | { |
| 70 | - if (! config('app.debug')) { |
|
| 70 | + if (!config('app.debug')) { |
|
| 71 | 71 | if ($request->expectsJson()) { |
| 72 | 72 | return response()->json(['error' => 'Something went wrong.'], 404); |
| 73 | 73 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | ], 401); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - if (! empty($exception->guards()) && Arr::first($exception->guards()) == 'chief') { |
|
| 102 | + if (!empty($exception->guards()) && Arr::first($exception->guards()) == 'chief') { |
|
| 103 | 103 | return redirect()->guest(route('chief.back.login')); |
| 104 | 104 | } |
| 105 | 105 | |