@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | |
52 | 52 | |
53 | 53 | |
54 | - if (method_exists($model, 'isPublished') && ! $model->isPublished()) { |
|
54 | + if (method_exists($model, 'isPublished') && !$model->isPublished()) { |
|
55 | 55 | |
56 | 56 | /** When admin is logged in and this request is in preview mode, we allow the view */ |
57 | - if (! PreviewMode::fromRequest()->check()) { |
|
58 | - throw new NotFoundHttpException('Model found for request ['. $slug .'] but it is not published.'); |
|
57 | + if (!PreviewMode::fromRequest()->check()) { |
|
58 | + throw new NotFoundHttpException('Model found for request ['.$slug.'] but it is not published.'); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | - throw new NotFoundHttpException('No url or model found for request ['. $slug .'] for locale ['.$locale.'].'); |
|
69 | + throw new NotFoundHttpException('No url or model found for request ['.$slug.'] for locale ['.$locale.'].'); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | private static function createRedirect(string $url) |
@@ -59,15 +59,15 @@ discard block |
||
59 | 59 | { |
60 | 60 | $permission = 'update-page'; |
61 | 61 | |
62 | - if (in_array($verb, ['index','show'])) { |
|
62 | + if (in_array($verb, ['index', 'show'])) { |
|
63 | 63 | $permission = 'view-page'; |
64 | - } elseif (in_array($verb, ['create','store'])) { |
|
64 | + } elseif (in_array($verb, ['create', 'store'])) { |
|
65 | 65 | $permission = 'create-page'; |
66 | 66 | } elseif (in_array($verb, ['delete'])) { |
67 | 67 | $permission = 'delete-page'; |
68 | 68 | } |
69 | 69 | |
70 | - if (! auth()->guard('chief')->user()->hasPermissionTo($permission)) { |
|
70 | + if (!auth()->guard('chief')->user()->hasPermissionTo($permission)) { |
|
71 | 71 | throw NotAllowedManagerRoute::notAllowedPermission($permission, $this); |
72 | 72 | } |
73 | 73 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | public function fieldArrangement($key = null): FieldArrangement |
129 | 129 | { |
130 | 130 | if ($key == 'create') { |
131 | - return new FieldArrangement($this->fieldsWithAssistantFields()->filterBy(function ($field) { |
|
131 | + return new FieldArrangement($this->fieldsWithAssistantFields()->filterBy(function($field) { |
|
132 | 132 | return in_array($field->key, ['title']); |
133 | 133 | })); |
134 | 134 | } |
@@ -147,8 +147,8 @@ discard block |
||
147 | 147 | if ($this->model->id) { |
148 | 148 | return parent::details() |
149 | 149 | ->set('title', $this->model->title) |
150 | - ->set('intro', 'laatst aangepast op ' . $this->model->updated_at->format('d/m/Y H:i')) |
|
151 | - ->set('context', '<span class="inline-s">' . $this->assistant('publish')->publicationStatusAsLabel() . '</span>'); |
|
150 | + ->set('intro', 'laatst aangepast op '.$this->model->updated_at->format('d/m/Y H:i')) |
|
151 | + ->set('context', '<span class="inline-s">'.$this->assistant('publish')->publicationStatusAsLabel().'</span>'); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | return parent::details(); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | public function saveFields(): Manager |
158 | 158 | { |
159 | 159 | // Store the morph_key upon creation |
160 | - if (! $this->model->morph_key) { |
|
160 | + if (!$this->model->morph_key) { |
|
161 | 161 | $this->model->morph_key = $this->model->morphKey(); |
162 | 162 | } |
163 | 163 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | if (is_array_empty($translation)) { |
203 | 203 | |
204 | 204 | // Nullify all values |
205 | - $trans[$locale] = array_map(function ($value) { |
|
205 | + $trans[$locale] = array_map(function($value) { |
|
206 | 206 | return null; |
207 | 207 | }, $translation); |
208 | 208 | continue; |