@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $this->authorize('create-page'); |
| 33 | 33 | |
| 34 | 34 | $menuitem = new MenuItem(); |
| 35 | - $menuitem->type = MenuItem::TYPE_INTERNAL; // Default menu type |
|
| 35 | + $menuitem->type = MenuItem::TYPE_INTERNAL; // Default menu type |
|
| 36 | 36 | $menuitem->menu_type = $menutype; |
| 37 | 37 | |
| 38 | 38 | $menuitems = $this->prepareMenuItemsForAdminSelect->prepare( |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | ->performedOn($menu) |
| 58 | 58 | ->log('created'); |
| 59 | 59 | |
| 60 | - return redirect()->route('chief.back.menus.show', $menu->menu_type)->with('messages.success', $menu->label . ' is aangemaakt'); |
|
| 60 | + return redirect()->route('chief.back.menus.show', $menu->menu_type)->with('messages.success', $menu->label.' is aangemaakt'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | ->performedOn($menu) |
| 96 | 96 | ->log('updated'); |
| 97 | 97 | |
| 98 | - return redirect()->route('chief.back.menus.show', $menu->menu_type)->with('messages.success', $menu->label . ' is aangepast'); |
|
| 98 | + return redirect()->route('chief.back.menus.show', $menu->menu_type)->with('messages.success', $menu->label.' is aangepast'); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | public function destroy($id) |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | ->log('deleted'); |
| 113 | 113 | |
| 114 | 114 | return redirect()->route('chief.back.menus.show', $menuItem->menuType())->with('messages.warning', $message); |
| 115 | - } else { |
|
| 115 | + }else { |
|
| 116 | 116 | return redirect()->back()->with('messages.warning', 'Je menu item is niet verwijderd. Probeer opnieuw'); |
| 117 | 117 | } |
| 118 | 118 | } |
@@ -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 | - $query->where('name', 'LIKE', '%' . $search . '%'); |
|
| 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), |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | continue; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $rules['trans.' . $locale . '.label'] = 'required'; |
|
| 52 | - if ($this->request->get('trans.' . $locale . '.url') != null) { |
|
| 53 | - $rules['trans.' . $locale . '.url'] = 'url'; |
|
| 51 | + $rules['trans.'.$locale.'.label'] = 'required'; |
|
| 52 | + if ($this->request->get('trans.'.$locale.'.url') != null) { |
|
| 53 | + $rules['trans.'.$locale.'.url'] = 'url'; |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | $attributes = []; |
| 63 | 63 | |
| 64 | 64 | foreach (array_keys($this->request->all('trans')) as $locale) { |
| 65 | - $attributes['trans.' . $locale . '.label'] = $locale . ' label'; |
|
| 66 | - $attributes['trans.' . $locale . '.url'] = $locale . ' link'; |
|
| 65 | + $attributes['trans.'.$locale.'.label'] = $locale.' label'; |
|
| 66 | + $attributes['trans.'.$locale.'.url'] = $locale.' link'; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $attributes['owner_reference'] = 'Interne pagina'; |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | // Check if it is a relative |
| 96 | 96 | if ($this->isRelativeUrl($trans['url'])) { |
| 97 | - $data['trans'][$locale]['url'] = '/' . trim($trans['url'], '/'); |
|
| 98 | - } else { |
|
| 97 | + $data['trans'][$locale]['url'] = '/'.trim($trans['url'], '/'); |
|
| 98 | + }else { |
|
| 99 | 99 | $data['trans'][$locale]['url'] = Url::fromString($trans['url'])->secure()->get(); |
| 100 | 100 | } |
| 101 | 101 | |
@@ -112,6 +112,6 @@ discard block |
||
| 112 | 112 | // Check if passed url is not intended as a host instead of a relative path |
| 113 | 113 | $notIntentedAsRoot = (null == Root::fromString($url)->scheme() && false === strpos($url, '.')); |
| 114 | 114 | |
| 115 | - return ($notIntentedAsRoot && in_array($url, [$nakedUrl, '/' . $nakedUrl])); |
|
| 115 | + return ($notIntentedAsRoot && in_array($url, [$nakedUrl, '/'.$nakedUrl])); |
|
| 116 | 116 | } |
| 117 | 117 | } |
@@ -18,17 +18,17 @@ |
||
| 18 | 18 | public function handle($request, Closure $next) |
| 19 | 19 | { |
| 20 | 20 | // Verifies a valid signature and still outside expiration period |
| 21 | - if (! $request->hasValidSignature()) { |
|
| 21 | + if (!$request->hasValidSignature()) { |
|
| 22 | 22 | return redirect()->route('invite.expired'); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - if (! $invitation = Invitation::findByToken($request->token)) { |
|
| 25 | + if (!$invitation = Invitation::findByToken($request->token)) { |
|
| 26 | 26 | return redirect()->route('invite.expired'); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | if (in_array($invitation->getState(InvitationState::KEY), [InvitationState::accepted, InvitationState::revoked])) { |
| 30 | 30 | // We allow the user to pass if the invitee is already logged in. Otherwise the invite link cannot be reused. |
| 31 | - if (! auth()->guard('chief')->check() || ! auth()->guard('chief')->user()->is($invitation->invitee)) { |
|
| 31 | + if (!auth()->guard('chief')->check() || !auth()->guard('chief')->user()->is($invitation->invitee)) { |
|
| 32 | 32 | return redirect()->route('invite.expired'); |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -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 | |
@@ -24,19 +24,19 @@ |
||
| 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 | - } catch(UrlRecordNotFound $e) { |
|
| 30 | + } catch (UrlRecordNotFound $e) { |
|
| 31 | 31 | $this->warn('No record found for targeturl ['.$row[2].'], locale ['.$row[0].']'); |
| 32 | 32 | |
| 33 | 33 | return; |
| 34 | - } catch(RedirectUrlAlreadyExists $e) { |
|
| 34 | + } catch (RedirectUrlAlreadyExists $e) { |
|
| 35 | 35 | $this->warn('Redirect url already exists as record ['.$row[1].'], locale ['.$row[0].']'); |
| 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'); |
@@ -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 | } |