@@ -53,13 +53,13 @@ |
||
53 | 53 | |
54 | 54 | if ($child instanceof Module && $child->isPageSpecific()) { |
55 | 55 | $duplicatedChild = $child::create([ |
56 | - 'slug' => $targetModel->title ? $targetModel->title . '-' . $child->slug : $child->slug . '-copy', |
|
56 | + 'slug' => $targetModel->title ? $targetModel->title.'-'.$child->slug : $child->slug.'-copy', |
|
57 | 57 | 'owner_id' => $targetModel->id, |
58 | 58 | 'owner_type' => $targetModel->getMorphClass() |
59 | 59 | ]); |
60 | 60 | |
61 | 61 | $this->moduleTemplateApplicator->handle($child, $duplicatedChild); |
62 | - } else { |
|
62 | + }else { |
|
63 | 63 | $duplicatedChild = $child; |
64 | 64 | } |
65 | 65 |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | } |
95 | 95 | |
96 | 96 | foreach ($replacements as $replacement) { |
97 | - $newKeySet[] = str_replace(':' . $placeholder, $replacement, $key); |
|
97 | + $newKeySet[] = str_replace(':'.$placeholder, $replacement, $key); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | // Remove all 'trans' entries for this locale |
144 | 144 | foreach ($filteredKeys as $i => $key) { |
145 | - if (Str::startsWith($key, 'trans.' . $locale)) { |
|
145 | + if (Str::startsWith($key, 'trans.'.$locale)) { |
|
146 | 146 | unset($filteredKeys[$i]); |
147 | 147 | } |
148 | 148 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $payload = Arr::get($this->payload, $key, '_notfound_'); |
164 | 164 | |
165 | 165 | // If the payload is empty and this is not the entry for the required locale |
166 | - if ($payload !== '_notfound_' && !$payload && !Str::endsWith($key, '.' . $this->requiredLocale)) { |
|
166 | + if ($payload !== '_notfound_' && !$payload && !Str::endsWith($key, '.'.$this->requiredLocale)) { |
|
167 | 167 | unset($filteredKeys[$i]); |
168 | 168 | } |
169 | 169 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | if (isset($customRules[$rule])) { |
52 | - $rules[$k] = $customRules[$rule] . ($params ? ':' . $params : ''); |
|
52 | + $rules[$k] = $customRules[$rule].($params ? ':'.$params : ''); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | public function tagged($tag): bool |
10 | 10 | { |
11 | - $tags = (array) $tag; |
|
11 | + $tags = (array)$tag; |
|
12 | 12 | |
13 | 13 | return count(array_intersect($this->tags, $tags)) > 0; |
14 | 14 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | { |
21 | 21 | return (new static(new FieldType(FieldType::IMAGE), $key)) |
22 | 22 | ->locales([config('app.fallback_locale', 'nl')]) |
23 | - ->valueResolver(function ($model = null, $locale = null, ImageField $field) { |
|
23 | + ->valueResolver(function($model = null, $locale = null, ImageField $field) { |
|
24 | 24 | return $field->getMedia($model, $locale); |
25 | 25 | }); |
26 | 26 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $images = []; |
40 | 40 | $locale = $locale ?? app()->getLocale(); |
41 | 41 | |
42 | - $assets = $model->assetRelation->where('pivot.type', $this->getKey())->filter(function ($asset) use ($locale) { |
|
42 | + $assets = $model->assetRelation->where('pivot.type', $this->getKey())->filter(function($asset) use ($locale) { |
|
43 | 43 | return $asset->pivot->locale == $locale; |
44 | 44 | })->sortBy('pivot.order'); |
45 | 45 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | { |
22 | 22 | return (new static(new FieldType(FieldType::FILE), $key)) |
23 | 23 | ->locales([config('app.fallback_locale', 'nl')]) |
24 | - ->valueResolver(function ($model = null, $locale = null, FileField $field) { |
|
24 | + ->valueResolver(function($model = null, $locale = null, FileField $field) { |
|
25 | 25 | return $field->getMedia($model, $locale); |
26 | 26 | }); |
27 | 27 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $files = []; |
36 | 36 | $locale = $locale ?? app()->getLocale(); |
37 | 37 | |
38 | - $assets = $model->assetRelation->where('pivot.type', $this->getKey())->filter(function ($asset) use ($locale) { |
|
38 | + $assets = $model->assetRelation->where('pivot.type', $this->getKey())->filter(function($asset) use ($locale) { |
|
39 | 39 | return $asset->pivot->locale == $locale; |
40 | 40 | })->sortBy('pivot.order'); |
41 | 41 |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | */ |
264 | 264 | private function defaultEloquentValueResolver(): \Closure |
265 | 265 | { |
266 | - return function (Model $model = null, $locale = null) { |
|
266 | + return function(Model $model = null, $locale = null) { |
|
267 | 267 | if ($this->value) { |
268 | 268 | return $this->value; |
269 | 269 | } |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | |
421 | 421 | return $this->isLocalized() |
422 | 422 | ? 'chief::back._formgroups.fieldgroup_translatable' |
423 | - : 'chief::back._fields.' . $this->type->get(); |
|
423 | + : 'chief::back._fields.'.$this->type->get(); |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | public function viewData(array $viewData = []): Field |
@@ -6,19 +6,19 @@ |
||
6 | 6 | |
7 | 7 | class FieldType |
8 | 8 | { |
9 | - const INPUT = 'input'; // oneliner text (input) |
|
10 | - const TEXT = 'text'; // Plain text (textarea) |
|
9 | + const INPUT = 'input'; // oneliner text (input) |
|
10 | + const TEXT = 'text'; // Plain text (textarea) |
|
11 | 11 | const NUMBER = 'number'; // number |
12 | 12 | const RANGE = 'range'; // range slider |
13 | - const DATE = 'date'; // Timestamp input |
|
14 | - const PHONENUMBER = 'phonenumber'; // Timestamp input |
|
15 | - const HTML = 'html'; // Html text (wysiwyg) |
|
16 | - const SELECT = 'select'; // Select options |
|
17 | - const FILE = 'file'; // regular file |
|
18 | - const IMAGE = 'image'; // image (slim uploader) |
|
19 | - const RADIO = 'radio'; // radio select |
|
20 | - const CHECKBOX = 'checkbox'; // checkbox select |
|
21 | - const PAGEBUILDER = 'pagebuilder'; // the most special field there is... |
|
13 | + const DATE = 'date'; // Timestamp input |
|
14 | + const PHONENUMBER = 'phonenumber'; // Timestamp input |
|
15 | + const HTML = 'html'; // Html text (wysiwyg) |
|
16 | + const SELECT = 'select'; // Select options |
|
17 | + const FILE = 'file'; // regular file |
|
18 | + const IMAGE = 'image'; // image (slim uploader) |
|
19 | + const RADIO = 'radio'; // radio select |
|
20 | + const CHECKBOX = 'checkbox'; // checkbox select |
|
21 | + const PAGEBUILDER = 'pagebuilder'; // the most special field there is... |
|
22 | 22 | const FRAGMENT = 'fragment'; |
23 | 23 | const PAGE = 'page'; // select a page (also a special field) |
24 | 24 |
@@ -79,7 +79,7 @@ |
||
79 | 79 | return $value; |
80 | 80 | } |
81 | 81 | |
82 | - $value = str_replace('.', '][', $value) . ']'; |
|
82 | + $value = str_replace('.', '][', $value).']'; |
|
83 | 83 | |
84 | 84 | return substr_replace($value, '', strpos($value, ']'), 1); |
85 | 85 | } |