@@ -28,19 +28,19 @@ |
||
28 | 28 | Blade::component('chief::templates.mail.template', 'chief::mail.template'); |
29 | 29 | |
30 | 30 | // Chief directives |
31 | - Blade::directive('adminRoute', function ($expression) { |
|
31 | + Blade::directive('adminRoute', function($expression) { |
|
32 | 32 | return "<?php echo \$manager->route({$expression}); ?>"; |
33 | 33 | }); |
34 | 34 | |
35 | - Blade::directive('adminCan', function ($expression) { |
|
35 | + Blade::directive('adminCan', function($expression) { |
|
36 | 36 | return "<?php if (isset(\$manager) && \$manager->can({$expression})) { ?>"; |
37 | 37 | }); |
38 | 38 | |
39 | - Blade::directive('elseAdminCan', function () { |
|
39 | + Blade::directive('elseAdminCan', function() { |
|
40 | 40 | return '<?php } else { ?>'; |
41 | 41 | }); |
42 | 42 | |
43 | - Blade::directive('endAdminCan', function () { |
|
43 | + Blade::directive('endAdminCan', function() { |
|
44 | 44 | return '<?php } ?>'; |
45 | 45 | }); |
46 | 46 |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | $this->bootFrontendEssentials(); |
81 | 81 | |
82 | - if (! $this->app->make(AdminEnvironment::class)->check(request())) { |
|
82 | + if (!$this->app->make(AdminEnvironment::class)->check(request())) { |
|
83 | 83 | return; |
84 | 84 | } |
85 | 85 | |
@@ -119,29 +119,29 @@ discard block |
||
119 | 119 | (new ConsoleServiceProvider($this->app))->register(); |
120 | 120 | } |
121 | 121 | |
122 | - $this->app->singleton(Registry::class, function () { |
|
122 | + $this->app->singleton(Registry::class, function() { |
|
123 | 123 | return new Registry([]); |
124 | 124 | }); |
125 | 125 | |
126 | - $this->app->singleton(Settings::class, function () { |
|
126 | + $this->app->singleton(Settings::class, function() { |
|
127 | 127 | return new Settings; |
128 | 128 | }); |
129 | 129 | |
130 | 130 | (new SquantoServiceProvider($this->app))->register(); |
131 | 131 | |
132 | - $this->app->bind(SitemapXml::class, function () { |
|
132 | + $this->app->bind(SitemapXml::class, function() { |
|
133 | 133 | return new SitemapXml(new Client(['verify' => false])); |
134 | 134 | }); |
135 | 135 | |
136 | 136 | if ($this->app->make(AdminEnvironment::class)->check(request())) { |
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 | 143 | // Global chief nav singleton |
144 | - $this->app->singleton(Nav::class, function () { |
|
144 | + $this->app->singleton(Nav::class, function() { |
|
145 | 145 | return new Nav; |
146 | 146 | }); |
147 | 147 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | 'role' => \Thinktomorrow\Chief\Admin\Authorization\Role::class, |
176 | 176 | ]; |
177 | 177 | |
178 | - Auth::provider('chief-eloquent', function ($app, array $config) { |
|
178 | + Auth::provider('chief-eloquent', function($app, array $config) { |
|
179 | 179 | return new ChiefUserProvider($app['hash'], $config['model']); |
180 | 180 | }); |
181 | 181 | } |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | Relation::morphMap(['chiefuser' => User::class]); |
246 | 246 | Relation::morphMap(['menuitem' => MenuItem::class]); |
247 | 247 | |
248 | - Blade::directive('fragments', function () { |
|
248 | + Blade::directive('fragments', function() { |
|
249 | 249 | 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()); ?>'; |
250 | 250 | }); |
251 | 251 | } |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | return; |
38 | 38 | } |
39 | 39 | |
40 | - app()->booted(function () { |
|
40 | + app()->booted(function() { |
|
41 | 41 | $routeName = config('chief.route.name'); |
42 | 42 | |
43 | - Route::get('{slug?}', function ($slug = '/') { |
|
43 | + Route::get('{slug?}', function($slug = '/') { |
|
44 | 44 | return ChiefResponse::fromSlug($slug); |
45 | 45 | })->name($routeName) |
46 | 46 | ->where('slug', '(.*)?') |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | |
51 | 51 | private function loadOpenAdminRoutes(): void |
52 | 52 | { |
53 | - Route::group(['prefix' => config('chief.route.prefix', 'admin'), 'middleware' => ['web']], function () { |
|
53 | + Route::group(['prefix' => config('chief.route.prefix', 'admin'), 'middleware' => ['web']], function() { |
|
54 | 54 | $this->loadRoutesFrom(__DIR__.'/../../routes/chief-open-routes.php'); |
55 | 55 | }); |
56 | 56 | } |
57 | 57 | |
58 | 58 | private function loadAdminRoutes(): void |
59 | 59 | { |
60 | - Route::group(['prefix' => config('chief.route.prefix', 'admin'), 'middleware' => ['web-chief', 'auth:chief']], function () { |
|
60 | + Route::group(['prefix' => config('chief.route.prefix', 'admin'), 'middleware' => ['web-chief', 'auth:chief']], function() { |
|
61 | 61 | $this->loadRoutesFrom(__DIR__.'/../../routes/chief-admin-routes.php'); |
62 | 62 | |
63 | 63 | // Add project specific chief routing... |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $roles = $request['roles']; |
50 | 50 | |
51 | 51 | $permission->save(); |
52 | - if (! empty($request['roles'])) { |
|
52 | + if (!empty($request['roles'])) { |
|
53 | 53 | foreach ($roles as $role) { |
54 | 54 | $r = Role::where('id', '=', $role)->firstOrFail(); // Match input role to db record |
55 | 55 | $permission = Permission::where('name', '=', $name)->first(); |
@@ -95,7 +95,7 @@ |
||
95 | 95 | $user = User::findOrFail($id); |
96 | 96 | |
97 | 97 | // Only another developer can change another developer. |
98 | - if (! chiefAdmin()->hasRole('developer') && ($user->hasRole('developer') || in_array('developer', $request->get('roles', [])))) { |
|
98 | + if (!chiefAdmin()->hasRole('developer') && ($user->hasRole('developer') || in_array('developer', $request->get('roles', [])))) { |
|
99 | 99 | throw new AuthorizationException('Constraint: Only an user with role developer can update an user with developer role.'); |
100 | 100 | } |
101 | 101 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $this->authorize('create-page'); |
31 | 31 | |
32 | 32 | $menuitem = new MenuItem; |
33 | - $menuitem->type = MenuItem::TYPE_INTERNAL; // Default menu type |
|
33 | + $menuitem->type = MenuItem::TYPE_INTERNAL; // Default menu type |
|
34 | 34 | $menuitem->menu_type = $menutype; |
35 | 35 | |
36 | 36 | $menuitems = $this->prepareMenuItemsForAdminSelect->prepare( |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ->log('deleted'); |
111 | 111 | |
112 | 112 | return redirect()->route('chief.back.menus.show', $menuItem->menuType())->with('messages.warning', $message); |
113 | - } else { |
|
113 | + }else { |
|
114 | 114 | return redirect()->back()->with('messages.warning', 'Je menu item is niet verwijderd. Probeer opnieuw'); |
115 | 115 | } |
116 | 116 | } |
@@ -25,14 +25,14 @@ |
||
25 | 25 | $links = Asset::with('media') |
26 | 26 | ->orderBy('created_at', 'DESC') |
27 | 27 | ->whereNotIn('id', $excluded) |
28 | - ->whereHas('media', function (Builder $query) use ($search) { |
|
28 | + ->whereHas('media', function(Builder $query) use ($search) { |
|
29 | 29 | $query->where('mime_type', 'LIKE', '%image%'); |
30 | 30 | $query->where('name', 'LIKE', '%'.$search.'%'); |
31 | 31 | }) |
32 | 32 | ->offset($offset) |
33 | 33 | ->limit($limit) |
34 | 34 | ->get() |
35 | - ->map(function ($asset) use ($conversion) { |
|
35 | + ->map(function($asset) use ($conversion) { |
|
36 | 36 | return [ |
37 | 37 | 'id' => $asset->id, |
38 | 38 | 'url' => $asset->url($conversion), |
@@ -94,7 +94,7 @@ |
||
94 | 94 | $data['trans'][$locale]['url'] = '/'.trim($trans['url'], '/'); |
95 | 95 | } elseif (Str::startsWith($trans['url'], ['mailto:', 'tel:', 'https://', 'http://'])) { |
96 | 96 | $data['trans'][$locale]['url'] = $trans['url']; |
97 | - } else { |
|
97 | + }else { |
|
98 | 98 | $data['trans'][$locale]['url'] = Url::fromString($trans['url'])->secure()->get(); |
99 | 99 | } |
100 | 100 |
@@ -61,12 +61,12 @@ discard block |
||
61 | 61 | |
62 | 62 | private function shouldRenderChiefException(Throwable $exception): bool |
63 | 63 | { |
64 | - return Str::startsWith(request()->path(), 'admin/') && ! $exception instanceof AuthenticationException && ! $exception instanceof ValidationException; |
|
64 | + return Str::startsWith(request()->path(), 'admin/') && !$exception instanceof AuthenticationException && !$exception instanceof ValidationException; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | protected function renderChiefException(\Illuminate\Http\Request $request, Throwable $exception) |
68 | 68 | { |
69 | - if (! config('app.debug')) { |
|
69 | + if (!config('app.debug')) { |
|
70 | 70 | if ($request->expectsJson()) { |
71 | 71 | return response()->json(['error' => 'Something went wrong.'], 404); |
72 | 72 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | ], 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 |