@@ -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 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | ], 401); |
102 | 102 | } |
103 | 103 | |
104 | - if (! empty($exception->guards()) && Arr::first($exception->guards()) == 'chief') { |
|
104 | + if (!empty($exception->guards()) && Arr::first($exception->guards()) == 'chief') { |
|
105 | 105 | return redirect()->guest(route('chief.back.login')); |
106 | 106 | } |
107 | 107 |
@@ -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 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | { |
23 | 23 | $menuItems = MenuItem::all(); |
24 | 24 | |
25 | - $this->info(count($menuItems) . ' menuitems will be updated.'); |
|
25 | + $this->info(count($menuItems).' menuitems will be updated.'); |
|
26 | 26 | |
27 | 27 | foreach ($menuItems as $menuItem) { |
28 | 28 | $this->projectModelData->handleByMenuItem($menuItem); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $role->givePermissionTo($request->permission_names); |
39 | 39 | |
40 | 40 | return redirect()->route('chief.back.roles.index') |
41 | - ->with('messages.success', 'Rol ' . $role->name . ' is toegevoegd.'); |
|
41 | + ->with('messages.success', 'Rol '.$role->name.' is toegevoegd.'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $this->authorize('update-role'); |
73 | 73 | |
74 | 74 | $this->validate($request, [ |
75 | - 'name' => 'required|alpha_dash|unique:roles,name,' . $id, |
|
75 | + 'name' => 'required|alpha_dash|unique:roles,name,'.$id, |
|
76 | 76 | 'permission_names' => 'required|array', |
77 | 77 | 'permission_names.*' => 'required', // Avoid null array entry |
78 | 78 | ]); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $role->syncPermissions($request->permission_names); |
84 | 84 | |
85 | 85 | return redirect()->route('chief.back.roles.index') |
86 | - ->with('messages.success', 'Rol ' . $role->name . ' is aangepast.'); |
|
86 | + ->with('messages.success', 'Rol '.$role->name.' is aangepast.'); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | public function destroy($id) |
@@ -94,6 +94,6 @@ discard block |
||
94 | 94 | $role->delete(); |
95 | 95 | |
96 | 96 | return redirect()->route('chief.back.roles.index') |
97 | - ->with('messages.success', 'Rol ' . $role->name . ' is verwijderd.'); |
|
97 | + ->with('messages.success', 'Rol '.$role->name.' is verwijderd.'); |
|
98 | 98 | } |
99 | 99 | } |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | return; |
39 | 39 | } |
40 | 40 | |
41 | - app()->booted(function () { |
|
41 | + app()->booted(function() { |
|
42 | 42 | $routeName = config('chief.route.name'); |
43 | 43 | |
44 | - Route::get('{slug?}', function ($slug = '/') { |
|
44 | + Route::get('{slug?}', function($slug = '/') { |
|
45 | 45 | return ChiefResponse::fromSlug($slug); |
46 | 46 | })->name($routeName) |
47 | 47 | ->where('slug', '(.*)?') |
@@ -51,15 +51,15 @@ discard block |
||
51 | 51 | |
52 | 52 | private function loadOpenAdminRoutes(): void |
53 | 53 | { |
54 | - Route::group(['prefix' => config('chief.route.prefix', 'admin'), 'middleware' => ['web']], function () { |
|
55 | - $this->loadRoutesFrom(__DIR__ . '/../../routes/chief-open-routes.php'); |
|
54 | + Route::group(['prefix' => config('chief.route.prefix', 'admin'), 'middleware' => ['web']], function() { |
|
55 | + $this->loadRoutesFrom(__DIR__.'/../../routes/chief-open-routes.php'); |
|
56 | 56 | }); |
57 | 57 | } |
58 | 58 | |
59 | 59 | private function loadAdminRoutes(): void |
60 | 60 | { |
61 | - Route::group(['prefix' => config('chief.route.prefix', 'admin'), 'middleware' => ['web-chief', 'auth:chief']], function () { |
|
62 | - $this->loadRoutesFrom(__DIR__ . '/../../routes/chief-admin-routes.php'); |
|
61 | + Route::group(['prefix' => config('chief.route.prefix', 'admin'), 'middleware' => ['web-chief', 'auth:chief']], function() { |
|
62 | + $this->loadRoutesFrom(__DIR__.'/../../routes/chief-admin-routes.php'); |
|
63 | 63 | |
64 | 64 | // Add project specific chief routing... |
65 | 65 | $projectChiefRoutePath = config('chief.route.admin-filepath', null); |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | continue; |
50 | 50 | } |
51 | 51 | |
52 | - $rules['trans.' . $locale . '.label'] = 'required'; |
|
53 | - if ($this->request->get('trans.' . $locale . '.url') != null) { |
|
54 | - $rules['trans.' . $locale . '.url'] = 'url'; |
|
52 | + $rules['trans.'.$locale.'.label'] = 'required'; |
|
53 | + if ($this->request->get('trans.'.$locale.'.url') != null) { |
|
54 | + $rules['trans.'.$locale.'.url'] = 'url'; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | $attributes = []; |
64 | 64 | |
65 | 65 | foreach (array_keys($this->request->all('trans')) as $locale) { |
66 | - $attributes['trans.' . $locale . '.label'] = $locale . ' label'; |
|
67 | - $attributes['trans.' . $locale . '.url'] = $locale . ' link'; |
|
66 | + $attributes['trans.'.$locale.'.label'] = $locale.' label'; |
|
67 | + $attributes['trans.'.$locale.'.url'] = $locale.' link'; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $attributes['owner_reference'] = 'Interne pagina'; |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | |
96 | 96 | // Check if it is a relative |
97 | 97 | if ($this->isRelativeUrl($trans['url'])) { |
98 | - $data['trans'][$locale]['url'] = '/' . trim($trans['url'], '/'); |
|
98 | + $data['trans'][$locale]['url'] = '/'.trim($trans['url'], '/'); |
|
99 | 99 | } elseif (Str::startsWith($trans['url'], ['mailto:', 'tel:', 'https://', 'http://'])) { |
100 | 100 | $data['trans'][$locale]['url'] = $trans['url']; |
101 | - } else { |
|
101 | + }else { |
|
102 | 102 | $data['trans'][$locale]['url'] = Url::fromString($trans['url'])->secure()->get(); |
103 | 103 | } |
104 | 104 | |
@@ -115,6 +115,6 @@ discard block |
||
115 | 115 | // Check if passed url is not intended as a host instead of a relative path |
116 | 116 | $notIntentedAsRoot = (null == Root::fromString($url)->getScheme() && false === strpos($url, '.')); |
117 | 117 | |
118 | - return ($notIntentedAsRoot && in_array($url, [$nakedUrl, '/' . $nakedUrl])); |
|
118 | + return ($notIntentedAsRoot && in_array($url, [$nakedUrl, '/'.$nakedUrl])); |
|
119 | 119 | } |
120 | 120 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public function handle(): void |
25 | 25 | { |
26 | 26 | // CSV should consist of: locale - redirect url - target -url |
27 | - $this->loop($this->argument('file'), function ($row) { |
|
27 | + $this->loop($this->argument('file'), function($row) { |
|
28 | 28 | try { |
29 | 29 | $this->addRedirect->handle($row[0], $row[1], $row[2]); |
30 | 30 | } catch (UrlRecordNotFound $e) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | return; |
38 | 38 | } |
39 | - $this->info('Added '.$row[0].' redirect: ' . $row[1] . ' -> ' . $row[2]); |
|
39 | + $this->info('Added '.$row[0].' redirect: '.$row[1].' -> '.$row[2]); |
|
40 | 40 | }); |
41 | 41 | |
42 | 42 | $this->info('Finished adding redirects'); |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | $locales = config('chief.locales'); |
25 | 25 | $locale = $this->argument('locale'); |
26 | 26 | |
27 | - if (! in_array($locale, $locales)) { |
|
28 | - throw new \InvalidArgumentException('Passed locale ' . $locale .' is not found as Chief locale. Available locales are ' . implode(',', $locales)); |
|
27 | + if (!in_array($locale, $locales)) { |
|
28 | + throw new \InvalidArgumentException('Passed locale '.$locale.' is not found as Chief locale. Available locales are '.implode(',', $locales)); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | $targetLocales = $locales; |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | { |
50 | 50 | return UrlRecord::allOnlineModels($locale) |
51 | 51 | // In case the url is not found or present for given locale. |
52 | - ->reject(function (Visitable $model) use ($locale) { |
|
53 | - return ! $model->url($locale); |
|
52 | + ->reject(function(Visitable $model) use ($locale) { |
|
53 | + return !$model->url($locale); |
|
54 | 54 | }); |
55 | 55 | } |
56 | 56 | } |
@@ -75,17 +75,17 @@ |
||
75 | 75 | |
76 | 76 | public function register() |
77 | 77 | { |
78 | - $this->callAfterResolving(Schedule::class, function (Schedule $schedule) { |
|
78 | + $this->callAfterResolving(Schedule::class, function(Schedule $schedule) { |
|
79 | 79 | $schedule->command('chief:sitemap')->dailyAt('01:00'); |
80 | 80 | $schedule->command('chief:image-sitemap')->weekly(); |
81 | 81 | }); |
82 | 82 | |
83 | 83 | // Setup commands |
84 | - $this->app->bind(CreatePageCommand::class, function ($app) { |
|
84 | + $this->app->bind(CreatePageCommand::class, function($app) { |
|
85 | 85 | return new CreatePageCommand($app->make(FileManipulation::class), new SetupConfig(config('chief.setup', []))); |
86 | 86 | }); |
87 | 87 | |
88 | - $this->app->bind(CreateFragmentCommand::class, function ($app) { |
|
88 | + $this->app->bind(CreateFragmentCommand::class, function($app) { |
|
89 | 89 | return new CreateFragmentCommand($app->make(FileManipulation::class), new SetupConfig(config('chief.setup', []))); |
90 | 90 | }); |
91 | 91 | } |