@@ -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 | |
@@ -25,15 +25,15 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | private function loadOpenAdminRoutes(): void |
| 27 | 27 | { |
| 28 | - Route::group(['prefix' => config('chief.route.prefix', 'admin'), 'middleware' => ['web']], function () { |
|
| 29 | - $this->loadRoutesFrom(__DIR__ . '/../../routes/chief-open-routes.php'); |
|
| 28 | + Route::group(['prefix' => config('chief.route.prefix', 'admin'), 'middleware' => ['web']], function() { |
|
| 29 | + $this->loadRoutesFrom(__DIR__.'/../../routes/chief-open-routes.php'); |
|
| 30 | 30 | }); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | private function loadAdminRoutes(): void |
| 34 | 34 | { |
| 35 | - Route::group(['prefix' => config('chief.route.prefix', 'admin'), 'middleware' => ['web-chief', 'auth:chief']], function () { |
|
| 36 | - $this->loadRoutesFrom(__DIR__ . '/../../routes/chief-admin-routes.php'); |
|
| 35 | + Route::group(['prefix' => config('chief.route.prefix', 'admin'), 'middleware' => ['web-chief', 'auth:chief']], function() { |
|
| 36 | + $this->loadRoutesFrom(__DIR__.'/../../routes/chief-admin-routes.php'); |
|
| 37 | 37 | |
| 38 | 38 | // Add project specific chief routing... |
| 39 | 39 | $projectChiefRoutePath = config('chief.route.admin-filepath', null); |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - app()->booted(function () { |
|
| 56 | + app()->booted(function() { |
|
| 57 | 57 | $routeName = config('chief.route.name'); |
| 58 | 58 | |
| 59 | - Route::get('{slug?}', function ($slug = '/') { |
|
| 59 | + Route::get('{slug?}', function($slug = '/') { |
|
| 60 | 60 | return ChiefResponse::fromSlug($slug); |
| 61 | 61 | })->name($routeName) |
| 62 | 62 | ->where('slug', '(.*)?') |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | View::composer([ |
| 19 | 19 | 'chief::manager._transitions.modals.archive-modal', |
| 20 | - ], function ($view) { |
|
| 20 | + ], function($view) { |
|
| 21 | 21 | $viewData = $view->getData(); |
| 22 | 22 | |
| 23 | 23 | $ignoredModel = (isset($viewData['model'])) |
@@ -54,23 +54,23 @@ discard block |
||
| 54 | 54 | Blade::component('chief::wireframes.rect', 'wireframe-rect'); |
| 55 | 55 | |
| 56 | 56 | // Chief directives |
| 57 | - Blade::directive('fragments', function () { |
|
| 57 | + Blade::directive('fragments', function() { |
|
| 58 | 58 | return '<?php echo app(\\Thinktomorrow\\Chief\\Fragments\\FragmentsRenderer::class)->render($model, get_defined_vars()); ?>'; |
| 59 | 59 | }); |
| 60 | 60 | |
| 61 | - Blade::directive('adminRoute', function ($expression) { |
|
| 61 | + Blade::directive('adminRoute', function($expression) { |
|
| 62 | 62 | return "<?php echo \$manager->route({$expression}); ?>"; |
| 63 | 63 | }); |
| 64 | 64 | |
| 65 | - Blade::directive('adminCan', function ($expression) { |
|
| 65 | + Blade::directive('adminCan', function($expression) { |
|
| 66 | 66 | return "<?php if (\$manager->can({$expression})) { ?>"; |
| 67 | 67 | }); |
| 68 | 68 | |
| 69 | - Blade::directive('elseAdminCan', function () { |
|
| 69 | + Blade::directive('elseAdminCan', function() { |
|
| 70 | 70 | return '<?php } else { ?>'; |
| 71 | 71 | }); |
| 72 | 72 | |
| 73 | - Blade::directive('endAdminCan', function () { |
|
| 73 | + Blade::directive('endAdminCan', function() { |
|
| 74 | 74 | return '<?php } ?>'; |
| 75 | 75 | }); |
| 76 | 76 | |
@@ -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 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | $this->app['view']->addNamespace('chief-site', __DIR__.'/../../resources/views/site'); |
| 55 | 55 | |
| 56 | - if (! $this->app->make(AdminEnvironment::class)->check()) { |
|
| 56 | + if (!$this->app->make(AdminEnvironment::class)->check()) { |
|
| 57 | 57 | return; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -89,11 +89,11 @@ discard block |
||
| 89 | 89 | (new ConsoleServiceProvider($this->app))->register(); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - $this->app->singleton(Registry::class, function () { |
|
| 92 | + $this->app->singleton(Registry::class, function() { |
|
| 93 | 93 | return new Registry([]); |
| 94 | 94 | }); |
| 95 | 95 | |
| 96 | - $this->app->singleton(Settings::class, function () { |
|
| 96 | + $this->app->singleton(Settings::class, function() { |
|
| 97 | 97 | return new Settings(); |
| 98 | 98 | }); |
| 99 | 99 | |
@@ -102,13 +102,13 @@ discard block |
||
| 102 | 102 | if ($this->app->make(AdminEnvironment::class)->check()) { |
| 103 | 103 | $this->app->when(SettingsController::class) |
| 104 | 104 | ->needs(SettingFields::class) |
| 105 | - ->give(function () { |
|
| 105 | + ->give(function() { |
|
| 106 | 106 | return new SettingFields(new Settings()); |
| 107 | 107 | }) |
| 108 | 108 | ; |
| 109 | 109 | |
| 110 | 110 | // Global chief nav singleton |
| 111 | - $this->app->singleton(Nav::class, function () { |
|
| 111 | + $this->app->singleton(Nav::class, function() { |
|
| 112 | 112 | return new Nav(); |
| 113 | 113 | }); |
| 114 | 114 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | 'role' => \Thinktomorrow\Chief\Admin\Authorization\Role::class, |
| 143 | 143 | ]; |
| 144 | 144 | |
| 145 | - Auth::provider('chief-eloquent', function ($app, array $config) { |
|
| 145 | + Auth::provider('chief-eloquent', function($app, array $config) { |
|
| 146 | 146 | return new ChiefUserProvider($app['hash'], $config['model']); |
| 147 | 147 | }); |
| 148 | 148 | } |