@@ -59,7 +59,7 @@ |
||
| 59 | 59 | private function addCustomValidationMessage($attribute, $params, $validator): void |
| 60 | 60 | { |
| 61 | 61 | $validator->setCustomMessages([ |
| 62 | - 'imagefield_max' => ':attribute is te groot en dient kleiner te zijn dan ' . implode(',', $params) . 'Kb.', |
|
| 62 | + 'imagefield_max' => ':attribute is te groot en dient kleiner te zijn dan '.implode(',', $params).'Kb.', |
|
| 63 | 63 | ]); |
| 64 | 64 | |
| 65 | 65 | if (!isset($validator->customAttributes[$attribute])) { |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | private function addCustomValidationMessage($attribute, $params, $validator): void |
| 39 | 39 | { |
| 40 | 40 | $validator->setCustomMessages([ |
| 41 | - 'filefield_mimetypes' => ':attribute is niet het juiste bestandstype. Volgende types zijn geldig: ' . implode(', ', $params), |
|
| 41 | + 'filefield_mimetypes' => ':attribute is niet het juiste bestandstype. Volgende types zijn geldig: '.implode(', ', $params), |
|
| 42 | 42 | ]); |
| 43 | 43 | |
| 44 | 44 | if (!isset($validator->customAttributes[$attribute])) { |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | private function addCustomValidationMessage($attribute, $params, $validator): void |
| 55 | 55 | { |
| 56 | 56 | $validator->setCustomMessages([ |
| 57 | - 'imagefield_min' => ':attribute is te klein en dient groter te zijn dan ' . implode(',', $params) . 'Kb.', |
|
| 57 | + 'imagefield_min' => ':attribute is te klein en dient groter te zijn dan '.implode(',', $params).'Kb.', |
|
| 58 | 58 | ]); |
| 59 | 59 | |
| 60 | 60 | if (!isset($validator->customAttributes[$attribute])) { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $mimetype = json_decode($value)->output->type; |
| 39 | 39 | |
| 40 | 40 | return (in_array($mimetype, $parameters) || |
| 41 | - in_array(explode('/', $mimetype)[0] . '/*', $parameters)); |
|
| 41 | + in_array(explode('/', $mimetype)[0].'/*', $parameters)); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | private function addCustomValidationMessage($attribute, $params, $validator): void |
| 50 | 50 | { |
| 51 | 51 | $validator->setCustomMessages([ |
| 52 | - 'imagefield_mimetypes' => ':attribute is niet het juiste bestandstype. Volgende types zijn geldig: ' . implode(', ', $params), |
|
| 52 | + 'imagefield_mimetypes' => ':attribute is niet het juiste bestandstype. Volgende types zijn geldig: '.implode(', ', $params), |
|
| 53 | 53 | ]); |
| 54 | 54 | |
| 55 | 55 | if (!isset($validator->customAttributes[$attribute])) { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | ->performedOn($this->manager->existingModel()) |
| 62 | 62 | ->log('published'); |
| 63 | 63 | |
| 64 | - return redirect()->back()->with('messages.success', $this->manager->details()->title . ' is online gezet.'); |
|
| 64 | + return redirect()->back()->with('messages.success', $this->manager->details()->title.' is online gezet.'); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public function unpublish() |
@@ -75,12 +75,12 @@ discard block |
||
| 75 | 75 | ->performedOn($this->manager->existingModel()) |
| 76 | 76 | ->log('unpublished'); |
| 77 | 77 | |
| 78 | - return redirect()->back()->with('messages.success', $this->manager->details()->title . ' is offline gehaald.'); |
|
| 78 | + return redirect()->back()->with('messages.success', $this->manager->details()->title.' is offline gehaald.'); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | public function findAll(): Collection |
| 82 | 82 | { |
| 83 | - return $this->manager->existingModel()->published()->get()->map(function ($model) { |
|
| 83 | + return $this->manager->existingModel()->published()->get()->map(function($model) { |
|
| 84 | 84 | return $this->managers->findByModel($model); |
| 85 | 85 | }); |
| 86 | 86 | } |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | $class = 'text-warning'; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - $statusAsLabel = '<span class="' . $class . '">' . $label . '</span>'; |
|
| 140 | + $statusAsLabel = '<span class="'.$class.'">'.$label.'</span>'; |
|
| 141 | 141 | |
| 142 | 142 | if (!$plain && $this->hasPreviewUrl()) { |
| 143 | - $statusAsLabel = '<a href="' . $this->previewUrl() . '" target="_blank">' . $statusAsLabel . '</a>'; |
|
| 143 | + $statusAsLabel = '<a href="'.$this->previewUrl().'" target="_blank">'.$statusAsLabel.'</a>'; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | return $statusAsLabel; |
@@ -141,10 +141,10 @@ discard block |
||
| 141 | 141 | return $filename; |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - $extension = substr($filename, strrpos($filename, '.') + 1); |
|
| 144 | + $extension = substr($filename, strrpos($filename, '.')+1); |
|
| 145 | 145 | $filename = substr($filename, 0, strrpos($filename, '.')); |
| 146 | 146 | |
| 147 | - return Str::slug($filename) . '.' . $extension; |
|
| 147 | + return Str::slug($filename).'.'.$extension; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | protected function sort(HasAsset $model, MediaField $field, Request $request) |
@@ -170,8 +170,8 @@ discard block |
||
| 170 | 170 | $values = isset($fileIdInput[$key]) |
| 171 | 171 | ? $fileIdInput[$key] |
| 172 | 172 | : ( |
| 173 | - isset($fileIdInput['files-' . $key]) |
|
| 174 | - ? $fileIdInput['files-' . $key] |
|
| 173 | + isset($fileIdInput['files-'.$key]) |
|
| 174 | + ? $fileIdInput['files-'.$key] |
|
| 175 | 175 | : '' |
| 176 | 176 | ); |
| 177 | 177 | |
@@ -6,22 +6,22 @@ |
||
| 6 | 6 | |
| 7 | 7 | class FieldType |
| 8 | 8 | { |
| 9 | - const INPUT = 'input'; // oneliner text (input) |
|
| 10 | - const TEXT = 'text'; // Plain text (textarea) |
|
| 11 | - const NUMBER = 'number'; // number |
|
| 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 |
|
| 9 | + const INPUT = 'input'; // oneliner text (input) |
|
| 10 | + const TEXT = 'text'; // Plain text (textarea) |
|
| 11 | + const NUMBER = 'number'; // number |
|
| 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 | 17 | //const MEDIA = 'media'; // media file |
| 18 | - const FILE = 'file'; // regular file |
|
| 19 | - const IMAGE = 'image'; // image (slim uploader) |
|
| 20 | - const DOCUMENT = 'document'; // documents |
|
| 21 | - const RADIO = 'radio'; // radio select |
|
| 22 | - const CHECKBOX = 'checkbox'; // checkbox select |
|
| 23 | - const PAGEBUILDER = 'pagebuilder'; // the most special field there is... |
|
| 24 | - const PAGE = 'page'; // select a page (also a special field) |
|
| 18 | + const FILE = 'file'; // regular file |
|
| 19 | + const IMAGE = 'image'; // image (slim uploader) |
|
| 20 | + const DOCUMENT = 'document'; // documents |
|
| 21 | + const RADIO = 'radio'; // radio select |
|
| 22 | + const CHECKBOX = 'checkbox'; // checkbox select |
|
| 23 | + const PAGEBUILDER = 'pagebuilder'; // the most special field there is... |
|
| 24 | + const PAGE = 'page'; // select a page (also a special field) |
|
| 25 | 25 | |
| 26 | 26 | /** @var string */ |
| 27 | 27 | private $type; |
@@ -20,14 +20,14 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function options(array $morphKeys = []) |
| 22 | 22 | { |
| 23 | - if (! empty($morphKeys)) { |
|
| 24 | - $morphKeys = collect($morphKeys)->map(function ($key) { |
|
| 23 | + if (!empty($morphKeys)) { |
|
| 24 | + $morphKeys = collect($morphKeys)->map(function($key) { |
|
| 25 | 25 | return (new $key())->getMorphClass(); |
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | 28 | $pages = UrlHelper::modelsByType($morphKeys->toArray())->get(); |
| 29 | 29 | $pages = FlatReferencePresenter::toGroupedSelectValues($pages)->toArray(); |
| 30 | - } else { |
|
| 30 | + }else { |
|
| 31 | 31 | $pages = UrlHelper::allModelsWithoutSelf($this->model); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | public static function modelsByType(array $types, Model $ignoredModel = null, $online = true) |
| 77 | 77 | { |
| 78 | - $models = chiefMemoize('all-online-models', function () use ($types, $online) { |
|
| 78 | + $models = chiefMemoize('all-online-models', function() use ($types, $online) { |
|
| 79 | 79 | $builder = UrlRecord::whereNull('redirect_id') |
| 80 | 80 | ->select('model_type', 'model_id') |
| 81 | 81 | ->groupBy('model_type', 'model_id'); |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | $builder->whereIn('model_type', $types); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - return $builder->get()->mapToGroups(function ($record) { |
|
| 87 | + return $builder->get()->mapToGroups(function($record) { |
|
| 88 | 88 | return [$record->model_type => $record->model_id]; |
| 89 | - })->map(function ($record, $key) { |
|
| 89 | + })->map(function($record, $key) { |
|
| 90 | 90 | return Morphables::instance($key)->find($record->toArray()); |
| 91 | - })->map->reject(function ($model) use ($online) { |
|
| 91 | + })->map->reject(function($model) use ($online) { |
|
| 92 | 92 | if ($online) { |
| 93 | 93 | return is_null($model) || !$model->isPublished(); |
| 94 | 94 | } // Invalid references to archived or removed models where url record still exists. |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | }); |
| 99 | 99 | |
| 100 | 100 | if ($ignoredModel) { |
| 101 | - $models = $models->reject(function ($model) use ($ignoredModel) { |
|
| 101 | + $models = $models->reject(function($model) use ($ignoredModel) { |
|
| 102 | 102 | return (get_class($model) === get_class($ignoredModel) && $model->id === $ignoredModel->id); |
| 103 | 103 | }); |
| 104 | 104 | } |