@@ -18,18 +18,18 @@ |
||
| 18 | 18 | public function handle($request, Closure $next) |
| 19 | 19 | { |
| 20 | 20 | // Verifies a valid signature and still outside expiration period |
| 21 | - if (! $request->hasValidSignature()) { |
|
| 21 | + if (!$request->hasValidSignature()) { |
|
| 22 | 22 | return redirect()->route('invite.expired'); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - if (! $invitation = Invitation::findByToken($request->token)) { |
|
| 25 | + if (!$invitation = Invitation::findByToken($request->token)) { |
|
| 26 | 26 | return redirect()->route('invite.expired'); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | if (in_array($invitation->stateOf(InvitationState::KEY), [InvitationState::ACCEPTED, InvitationState::REVOKED])) { |
| 30 | 30 | |
| 31 | 31 | // We allow the user to pass if the invitee is already logged in. Otherwise the invite link cannot be reused. |
| 32 | - if (! auth()->guard('chief')->check() || ! auth()->guard('chief')->user()->is($invitation->invitee)) { |
|
| 32 | + if (!auth()->guard('chief')->check() || !auth()->guard('chief')->user()->is($invitation->invitee)) { |
|
| 33 | 33 | return redirect()->route('invite.expired'); |
| 34 | 34 | } |
| 35 | 35 | } |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | protected function unauthorized(\Illuminate\Http\Request $request, AuthorizationException $exception) |
| 83 | 83 | { |
| 84 | 84 | return redirect()->route('chief.back.dashboard') |
| 85 | - ->with('messages.error', 'Oeps. Het lijkt erop dat je geen toegang hebt tot dit deel van chief. Vraag even de beheerder voor meer info.'); |
|
| 85 | + ->with('messages.error', 'Oeps. Het lijkt erop dat je geen toegang hebt tot dit deel van chief. Vraag even de beheerder voor meer info.'); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -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(\Illuminate\Http\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 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | return response()->json(['error' => 'Unauthenticated.'], 401); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - if (! empty($exception->guards()) && Arr::first($exception->guards()) == 'chief') { |
|
| 101 | + if (!empty($exception->guards()) && Arr::first($exception->guards()) == 'chief') { |
|
| 102 | 102 | return redirect()->guest(route('chief.back.login')); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $password = $passwordConfirm = null; |
| 30 | 30 | $tries = 0; |
| 31 | 31 | |
| 32 | - while (! $password || strlen($password) < 4 || $password != $passwordConfirm) { |
|
| 32 | + while (!$password || strlen($password) < 4 || $password != $passwordConfirm) { |
|
| 33 | 33 | if ($tries > 2) { |
| 34 | 34 | throw new \Exception('Aborting. Too many failed attempts to set password'); |
| 35 | 35 | } |
@@ -9,12 +9,12 @@ |
||
| 9 | 9 | |
| 10 | 10 | public function handle(): void |
| 11 | 11 | { |
| 12 | - if (! $this->hasArgument('part')) { |
|
| 12 | + if (!$this->hasArgument('part')) { |
|
| 13 | 13 | $part = $this->ask('which part'); |
| 14 | - } else { |
|
| 14 | + }else { |
|
| 15 | 15 | $part = $this->argument('part'); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - $this->info($part . ' published'); |
|
| 18 | + $this->info($part.' published'); |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | if ($this->option('reset')) { |
| 20 | - if (! $this->confirm('You are about to force reset the database in the ' . app()->environment() . ' environment! ARE YOU SURE?')) { |
|
| 20 | + if (!$this->confirm('You are about to force reset the database in the '.app()->environment().' environment! ARE YOU SURE?')) { |
|
| 21 | 21 | $this->info('aborting.'); |
| 22 | 22 | |
| 23 | 23 | return; |
@@ -14,12 +14,12 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | public function handle() |
| 16 | 16 | { |
| 17 | - if (app()->environment() != 'local' && ! $this->option('force')) { |
|
| 17 | + if (app()->environment() != 'local' && !$this->option('force')) { |
|
| 18 | 18 | throw new \Exception('You can only run the seeder in the local environment since this will inject a ton of default data'); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | if (app()->environment() != 'local' && $this->option('force')) { |
| 22 | - if (! $this->confirm('You are about to inject default seeding data in the ' . app()->environment() . ' database! Are you sure?')) { |
|
| 22 | + if (!$this->confirm('You are about to inject default seeding data in the '.app()->environment().' database! Are you sure?')) { |
|
| 23 | 23 | $this->info('You are welcome. I have just saved your job.'); |
| 24 | 24 | |
| 25 | 25 | return; |
@@ -29,6 +29,6 @@ discard block |
||
| 29 | 29 | $seederClass = $this->argument('seeder'); |
| 30 | 30 | app($seederClass)->run(); |
| 31 | 31 | |
| 32 | - $this->info($seederClass . ' has run successfully.'); |
|
| 32 | + $this->info($seederClass.' has run successfully.'); |
|
| 33 | 33 | } |
| 34 | 34 | } |
@@ -25,9 +25,9 @@ |
||
| 25 | 25 | $locales = config('chief.locales'); |
| 26 | 26 | |
| 27 | 27 | foreach ($locales as $locale) { |
| 28 | - $filepath = public_path('sitemap-' . $locale . '.xml'); |
|
| 28 | + $filepath = public_path('sitemap-'.$locale.'.xml'); |
|
| 29 | 29 | |
| 30 | - $this->info('Generating a sitemap for locale: ' . $locale . ' at: ' . $filepath); |
|
| 30 | + $this->info('Generating a sitemap for locale: '.$locale.' at: '.$filepath); |
|
| 31 | 31 | |
| 32 | 32 | $this->sitemapXmlFile->create($locale, $filepath, $this->createAlternateLocales($locales, $locale)); |
| 33 | 33 | } |
@@ -17,11 +17,11 @@ discard block |
||
| 17 | 17 | $firstname = null; |
| 18 | 18 | $lastname = null; |
| 19 | 19 | |
| 20 | - while (! $firstname) { |
|
| 20 | + while (!$firstname) { |
|
| 21 | 21 | $firstname = $this->ask('firstname'); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - while (! $lastname) { |
|
| 24 | + while (!$lastname) { |
|
| 25 | 25 | $lastname = $this->ask('lastname'); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -31,22 +31,22 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | if ($this->option('dev')) { |
| 33 | 33 | $role = 'developer'; |
| 34 | - } else { |
|
| 34 | + }else { |
|
| 35 | 35 | $role = 'admin'; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $this->createUser($firstname, $lastname, $email, $password, [$role]); |
| 39 | 39 | |
| 40 | - $this->info($firstname . ' ' . $lastname . ' succesfully added as admin user.'); |
|
| 40 | + $this->info($firstname.' '.$lastname.' succesfully added as admin user.'); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | private function settingPermissionsAndRoles(): void |
| 44 | 44 | { |
| 45 | - AuthorizationDefaults::permissions()->each(function ($permissionName) { |
|
| 45 | + AuthorizationDefaults::permissions()->each(function($permissionName) { |
|
| 46 | 46 | Artisan::call('chief:permission', ['name' => $permissionName]); |
| 47 | 47 | }); |
| 48 | 48 | |
| 49 | - AuthorizationDefaults::roles()->each(function ($defaultPermissions, $roleName) { |
|
| 49 | + AuthorizationDefaults::roles()->each(function($defaultPermissions, $roleName) { |
|
| 50 | 50 | Artisan::call('chief:role', ['name' => $roleName, '--permissions' => implode(',', $defaultPermissions)]); |
| 51 | 51 | }); |
| 52 | 52 | |
@@ -62,17 +62,17 @@ discard block |
||
| 62 | 62 | (new $addonServiceProvider($this->app))->boot(); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'chief'); |
|
| 66 | - $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations'); |
|
| 67 | - $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'chief'); |
|
| 65 | + $this->loadViewsFrom(__DIR__.'/../../resources/views', 'chief'); |
|
| 66 | + $this->loadMigrationsFrom(__DIR__.'/../../database/migrations'); |
|
| 67 | + $this->loadTranslationsFrom(__DIR__.'/../../resources/lang', 'chief'); |
|
| 68 | 68 | |
| 69 | 69 | $this->publishes([ |
| 70 | - __DIR__ . '/../../config/chief.php' => config_path('chief.php'), |
|
| 71 | - __DIR__ . '/../../config/chief-settings.php' => config_path('chief-settings.php'), |
|
| 70 | + __DIR__.'/../../config/chief.php' => config_path('chief.php'), |
|
| 71 | + __DIR__.'/../../config/chief-settings.php' => config_path('chief-settings.php'), |
|
| 72 | 72 | ], 'chief-config'); |
| 73 | 73 | |
| 74 | 74 | $this->publishes([ |
| 75 | - __DIR__ . '/../../public/chief-assets' => public_path('/chief-assets'), |
|
| 75 | + __DIR__.'/../../public/chief-assets' => public_path('/chief-assets'), |
|
| 76 | 76 | ], 'chief-assets'); |
| 77 | 77 | |
| 78 | 78 | // Commands for both cli and web scripts |
@@ -124,37 +124,37 @@ discard block |
||
| 124 | 124 | public function register() |
| 125 | 125 | { |
| 126 | 126 | if ($this->app->runningInConsole()) { |
| 127 | - $this->callAfterResolving(Schedule::class, function (Schedule $schedule) { |
|
| 127 | + $this->callAfterResolving(Schedule::class, function(Schedule $schedule) { |
|
| 128 | 128 | $schedule->command('chief:sitemap')->dailyAt("01:00"); |
| 129 | 129 | }); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - $this->mergeConfigFrom(__DIR__ . '/../../config/chief.php', 'chief'); |
|
| 133 | - $this->mergeConfigFrom(__DIR__ . '/../../config/chief-settings.php', 'chief-settings'); |
|
| 132 | + $this->mergeConfigFrom(__DIR__.'/../../config/chief.php', 'chief'); |
|
| 133 | + $this->mergeConfigFrom(__DIR__.'/../../config/chief-settings.php', 'chief-settings'); |
|
| 134 | 134 | |
| 135 | 135 | $this->setupEnvironmentProviders(); |
| 136 | 136 | |
| 137 | 137 | $this->app->when(SettingsController::class) |
| 138 | 138 | ->needs(SettingFields::class) |
| 139 | - ->give(function () { |
|
| 139 | + ->give(function() { |
|
| 140 | 140 | return new SettingFields(new Settings()); |
| 141 | 141 | }); |
| 142 | 142 | |
| 143 | - $this->app->singleton(Registry::class, function () { |
|
| 143 | + $this->app->singleton(Registry::class, function() { |
|
| 144 | 144 | return new Registry([], [], new TaggedKeys()); |
| 145 | 145 | }); |
| 146 | 146 | |
| 147 | 147 | // Global chief nav singleton |
| 148 | - $this->app->singleton(Nav::class, function () { |
|
| 148 | + $this->app->singleton(Nav::class, function() { |
|
| 149 | 149 | return new Nav(); |
| 150 | 150 | }); |
| 151 | 151 | |
| 152 | 152 | // Setup commands |
| 153 | - $this->app->bind(CreatePageCommand::class, function ($app) { |
|
| 153 | + $this->app->bind(CreatePageCommand::class, function($app) { |
|
| 154 | 154 | return new CreatePageCommand($app->make(FileManipulation::class), new SetupConfig(config('chief.setup', []))); |
| 155 | 155 | }); |
| 156 | 156 | |
| 157 | - $this->app->bind(CreateFragmentCommand::class, function ($app) { |
|
| 157 | + $this->app->bind(CreateFragmentCommand::class, function($app) { |
|
| 158 | 158 | return new CreateFragmentCommand($app->make(FileManipulation::class), new SetupConfig(config('chief.setup', []))); |
| 159 | 159 | }); |
| 160 | 160 | |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | private function setupEnvironmentProviders(): void |
| 193 | 193 | { |
| 194 | - if (! $this->app->environment('production') && $services = config('app.providers-' . app()->environment(), false)) { |
|
| 194 | + if (!$this->app->environment('production') && $services = config('app.providers-'.app()->environment(), false)) { |
|
| 195 | 195 | foreach ($services as $service) { |
| 196 | 196 | $this->app->register($service); |
| 197 | 197 | } |
@@ -226,10 +226,10 @@ discard block |
||
| 226 | 226 | private function registerSquanto(): void |
| 227 | 227 | { |
| 228 | 228 | // Project specific squanto files |
| 229 | - $this->app['view']->addNamespace('squanto', __DIR__ . '/../../resources/views/vendor/squanto'); |
|
| 229 | + $this->app['view']->addNamespace('squanto', __DIR__.'/../../resources/views/vendor/squanto'); |
|
| 230 | 230 | |
| 231 | 231 | // Chief squanto defaults |
| 232 | - $this->app['view']->addNamespace('squanto', base_path() . '/resources/views/vendor/thinktomorrow/chief/vendor/squanto'); |
|
| 232 | + $this->app['view']->addNamespace('squanto', base_path().'/resources/views/vendor/thinktomorrow/chief/vendor/squanto'); |
|
| 233 | 233 | |
| 234 | 234 | // Use the chief routing |
| 235 | 235 | $this->app['config']['squanto.use_default_routes'] = false; |