@@ -20,7 +20,7 @@ |
||
| 20 | 20 | $adminRoute = config('chief.route.prefix', '/admin'); |
| 21 | 21 | |
| 22 | 22 | // Add exception routes for all chief admin endpoints. |
| 23 | - $this->except[] = rtrim($adminRoute, '/') . '/*'; |
|
| 23 | + $this->except[] = rtrim($adminRoute, '/').'/*'; |
|
| 24 | 24 | |
| 25 | 25 | return parent::handle($request, $next); |
| 26 | 26 | } |
@@ -38,10 +38,10 @@ |
||
| 38 | 38 | { |
| 39 | 39 | // Low level way to only allow TT users |
| 40 | 40 | // this is not a safe way to handle security and is only used for convenience, not to secure page restriction!! |
| 41 | - if (! $this->auth->user() || ! $this->authorize('update-squanto')) { |
|
| 41 | + if (!$this->auth->user() || !$this->authorize('update-squanto')) { |
|
| 42 | 42 | if ($request->ajax()) { |
| 43 | 43 | return response('Unauthorized.', 401); |
| 44 | - } else { |
|
| 44 | + }else { |
|
| 45 | 45 | return redirect()->guest('admin/login'); |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | return redirect('/'); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - if (! $request->user('chief')->can($permission)) { |
|
| 23 | + if (!$request->user('chief')->can($permission)) { |
|
| 24 | 24 | abort(403); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -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 | } |
@@ -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 | } |
@@ -66,16 +66,16 @@ |
||
| 66 | 66 | |
| 67 | 67 | public function register() |
| 68 | 68 | { |
| 69 | - $this->callAfterResolving(Schedule::class, function (Schedule $schedule) { |
|
| 69 | + $this->callAfterResolving(Schedule::class, function(Schedule $schedule) { |
|
| 70 | 70 | $schedule->command('chief:sitemap')->dailyAt('01:00'); |
| 71 | 71 | }); |
| 72 | 72 | |
| 73 | 73 | // Setup commands |
| 74 | - $this->app->bind(CreatePageCommand::class, function ($app) { |
|
| 74 | + $this->app->bind(CreatePageCommand::class, function($app) { |
|
| 75 | 75 | return new CreatePageCommand($app->make(FileManipulation::class), new SetupConfig(config('chief.setup', []))); |
| 76 | 76 | }); |
| 77 | 77 | |
| 78 | - $this->app->bind(CreateFragmentCommand::class, function ($app) { |
|
| 78 | + $this->app->bind(CreateFragmentCommand::class, function($app) { |
|
| 79 | 79 | return new CreateFragmentCommand($app->make(FileManipulation::class), new SetupConfig(config('chief.setup', []))); |
| 80 | 80 | }); |
| 81 | 81 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | $this->bootFrontendEssentials(); |
| 79 | 79 | |
| 80 | - if (! $this->app->make(AdminEnvironment::class)->check(request())) { |
|
| 80 | + if (!$this->app->make(AdminEnvironment::class)->check(request())) { |
|
| 81 | 81 | return; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -107,18 +107,18 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | public function register() |
| 109 | 109 | { |
| 110 | - $this->mergeConfigFrom(__DIR__ . '/../../config/chief.php', 'chief'); |
|
| 111 | - $this->mergeConfigFrom(__DIR__ . '/../../config/chief-settings.php', 'chief-settings'); |
|
| 110 | + $this->mergeConfigFrom(__DIR__.'/../../config/chief.php', 'chief'); |
|
| 111 | + $this->mergeConfigFrom(__DIR__.'/../../config/chief-settings.php', 'chief-settings'); |
|
| 112 | 112 | |
| 113 | 113 | if ($this->app->runningInConsole()) { |
| 114 | 114 | (new ConsoleServiceProvider($this->app))->register(); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $this->app->singleton(Registry::class, function () { |
|
| 117 | + $this->app->singleton(Registry::class, function() { |
|
| 118 | 118 | return new Registry([]); |
| 119 | 119 | }); |
| 120 | 120 | |
| 121 | - $this->app->singleton(Settings::class, function () { |
|
| 121 | + $this->app->singleton(Settings::class, function() { |
|
| 122 | 122 | return new Settings(); |
| 123 | 123 | }); |
| 124 | 124 | |
@@ -129,12 +129,12 @@ discard block |
||
| 129 | 129 | if ($this->app->make(AdminEnvironment::class)->check(request())) { |
| 130 | 130 | $this->app->when(SettingsController::class) |
| 131 | 131 | ->needs(SettingFields::class) |
| 132 | - ->give(function () { |
|
| 132 | + ->give(function() { |
|
| 133 | 133 | return new SettingFields(new Settings()); |
| 134 | 134 | }); |
| 135 | 135 | |
| 136 | 136 | // Global chief nav singleton |
| 137 | - $this->app->singleton(Nav::class, function () { |
|
| 137 | + $this->app->singleton(Nav::class, function() { |
|
| 138 | 138 | return new Nav(); |
| 139 | 139 | }); |
| 140 | 140 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | 'role' => \Thinktomorrow\Chief\Admin\Authorization\Role::class, |
| 169 | 169 | ]; |
| 170 | 170 | |
| 171 | - Auth::provider('chief-eloquent', function ($app, array $config) { |
|
| 171 | + Auth::provider('chief-eloquent', function($app, array $config) { |
|
| 172 | 172 | return new ChiefUserProvider($app['hash'], $config['model']); |
| 173 | 173 | }); |
| 174 | 174 | } |
@@ -176,10 +176,10 @@ discard block |
||
| 176 | 176 | private function bootChiefSquanto(): void |
| 177 | 177 | { |
| 178 | 178 | // Project specific squanto files |
| 179 | - $this->app['view']->addNamespace('squanto', __DIR__ . '/../../resources/views/vendor/squanto'); |
|
| 179 | + $this->app['view']->addNamespace('squanto', __DIR__.'/../../resources/views/vendor/squanto'); |
|
| 180 | 180 | |
| 181 | 181 | // Chief squanto defaults |
| 182 | - $this->app['view']->addNamespace('squanto', base_path() . '/resources/views/vendor/thinktomorrow/chief/vendor/squanto'); |
|
| 182 | + $this->app['view']->addNamespace('squanto', base_path().'/resources/views/vendor/thinktomorrow/chief/vendor/squanto'); |
|
| 183 | 183 | |
| 184 | 184 | // Use the chief routing |
| 185 | 185 | $this->app['config']['squanto.use_default_routes'] = false; |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | // User events |
| 191 | 191 | Event::listen(Login::class, LogSuccessfulLogin::class); |
| 192 | 192 | Event::listen(UserInvited::class, SendInvite::class); |
| 193 | - Event::listen(InviteAccepted::class, EnableUser::class . '@onAcceptingInvite'); |
|
| 193 | + Event::listen(InviteAccepted::class, EnableUser::class.'@onAcceptingInvite'); |
|
| 194 | 194 | |
| 195 | 195 | // Managed model events |
| 196 | 196 | Event::listen(ManagedModelCreated::class, [CreateUrlForPage::class, 'onManagedModelCreated']); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | Relation::morphMap(['fragmentmodel' => FragmentModel::class]); |
| 238 | 238 | |
| 239 | - Blade::directive('fragments', function () { |
|
| 239 | + Blade::directive('fragments', function() { |
|
| 240 | 240 | return '<?php echo app(\\Thinktomorrow\\Chief\\Fragments\\FragmentsRenderer::class)->render($model instanceof \Thinktomorrow\Chief\Shared\Concerns\Nestable\Tree\NestedNode ? $model->getModel() : $model, get_defined_vars()); ?>'; |
| 241 | 241 | }); |
| 242 | 242 | } |