@@ -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 |
@@ -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 |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | $firstname = null; |
19 | 19 | $lastname = null; |
20 | 20 | |
21 | - while (! $firstname) { |
|
21 | + while (!$firstname) { |
|
22 | 22 | $firstname = $this->ask('Firstname'); |
23 | 23 | } |
24 | 24 | |
25 | - while (! $lastname) { |
|
25 | + while (!$lastname) { |
|
26 | 26 | $lastname = $this->ask('Lastname'); |
27 | 27 | } |
28 | 28 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | if ($this->option('dev')) { |
34 | 34 | $role = 'developer'; |
35 | - } else { |
|
35 | + }else { |
|
36 | 36 | $role = 'admin'; |
37 | 37 | } |
38 | 38 | |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | |
44 | 44 | private function settingPermissionsAndRoles(): void |
45 | 45 | { |
46 | - AuthorizationDefaults::permissions()->each(function ($permissionName) { |
|
46 | + AuthorizationDefaults::permissions()->each(function($permissionName) { |
|
47 | 47 | Artisan::call('chief:permission', ['name' => $permissionName]); |
48 | 48 | }); |
49 | 49 | |
50 | - AuthorizationDefaults::roles()->each(function ($defaultPermissions, $roleName) { |
|
50 | + AuthorizationDefaults::roles()->each(function($defaultPermissions, $roleName) { |
|
51 | 51 | Artisan::call('chief:role', ['name' => $roleName, '--permissions' => implode(',', $defaultPermissions)]); |
52 | 52 | }); |
53 | 53 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | if ($this->option('reset')) { |
21 | - if (! $this->confirm('You are about to force reset the database in the '.app()->environment().' environment! ARE YOU SURE?')) { |
|
21 | + if (!$this->confirm('You are about to force reset the database in the '.app()->environment().' environment! ARE YOU SURE?')) { |
|
22 | 22 | $this->info('aborting.'); |
23 | 23 | |
24 | 24 | return; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | public function handle(): void |
27 | 27 | { |
28 | 28 | // CSV should consist of: locale - redirect url - target -url |
29 | - $this->loop($this->argument('file'), function ($row) { |
|
29 | + $this->loop($this->argument('file'), function($row) { |
|
30 | 30 | try { |
31 | 31 | $this->addRedirect->handle($row[0], $row[1], $row[2]); |
32 | 32 | } catch (UrlRecordNotFound $e) { |