@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | public function apply($value = null): Closure |
17 | 17 | { |
18 | - return $this->query && $this->query instanceof Closure ? $this->query : function ($query) { |
|
18 | + return $this->query && $this->query instanceof Closure ? $this->query : function($query) { |
|
19 | 19 | return $query; |
20 | 20 | }; |
21 | 21 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace Thinktomorrow\Chief\Fields\Types; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace Thinktomorrow\Chief\Fields\Types; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace Thinktomorrow\Chief\Fields\Types; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace Thinktomorrow\Chief\Fields\Types; |
5 | 5 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace Thinktomorrow\Chief\Fields\Types; |
5 | 5 |
@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | public function __toString() |
66 | 66 | { |
67 | - return (string) $this->get('key'); |
|
67 | + return (string)$this->get('key'); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $this->addModelToCollection($i, $child); |
79 | 79 | } |
80 | 80 | |
81 | - return $this->sets->values()->map(function (ViewableContract $child) { |
|
81 | + return $this->sets->values()->map(function(ViewableContract $child) { |
|
82 | 82 | return ($this->withSnippets && method_exists($child, 'withSnippets')) |
83 | 83 | ? $child->withSnippets()->setViewParent($this->parent)->renderView() |
84 | 84 | : $child->setViewParent($this->parent)->renderView(); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | // Only published pages you fool! |
97 | 97 | // TODO: check for assistant instead of method existence |
98 | - if (method_exists($model, 'isPublished') && ! $model->isPublished()) { |
|
98 | + if (method_exists($model, 'isPublished') && !$model->isPublished()) { |
|
99 | 99 | return; |
100 | 100 | } |
101 | 101 |
@@ -87,11 +87,11 @@ |
||
87 | 87 | return parent::fields()->add( |
88 | 88 | $this->pageBuilderField(), |
89 | 89 | InputField::make('title')->translatable($this->model->availableLocales()) |
90 | - ->validation('required-fallback-locale|max:200', [], [ |
|
91 | - 'trans.'.config('app.fallback_locale', 'nl').'.title' => 'title', |
|
92 | - ]) |
|
93 | - ->label('De titel van je '.$this->model->labelSingular ?? 'pagina') |
|
94 | - ->description('Dit is de titel die zal worden getoond in de overzichten en modules.'), |
|
90 | + ->validation('required-fallback-locale|max:200', [], [ |
|
91 | + 'trans.'.config('app.fallback_locale', 'nl').'.title' => 'title', |
|
92 | + ]) |
|
93 | + ->label('De titel van je '.$this->model->labelSingular ?? 'pagina') |
|
94 | + ->description('Dit is de titel die zal worden getoond in de overzichten en modules.'), |
|
95 | 95 | InputField::make('seo_title') |
96 | 96 | ->translatable($this->model->availableLocales()) |
97 | 97 | ->label('Zoekmachine titel'), |
@@ -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; |