@@ -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; |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | // options are always grouped |
| 23 | 23 | $this->grouped(); |
| 24 | 24 | |
| 25 | - if(empty($whitelistedKeys)) { |
|
| 25 | + if (empty($whitelistedKeys)) { |
|
| 26 | 26 | $this->options = UrlHelper::allModelsExcept($excludedPage); |
| 27 | 27 | return $this; |
| 28 | 28 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $whitelistedDatabaseTypes = []; |
| 80 | 80 | |
| 81 | - foreach($keys as $key) { |
|
| 81 | + foreach ($keys as $key) { |
|
| 82 | 82 | $manager = $managers->findByKey($key); |
| 83 | 83 | $whitelistedDatabaseTypes[] = $manager->modelInstance()->getMorphClass(); |
| 84 | 84 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | public static function modelsByType(array $types, Model $ignoredModel = null, $online = true) |
| 91 | 91 | { |
| 92 | - $models = chiefMemoize('all-online-models', function () use ($types, $online) { |
|
| 92 | + $models = chiefMemoize('all-online-models', function() use ($types, $online) { |
|
| 93 | 93 | $builder = UrlRecord::whereNull('redirect_id') |
| 94 | 94 | ->select('model_type', 'model_id') |
| 95 | 95 | ->groupBy('model_type', 'model_id'); |
@@ -98,11 +98,11 @@ discard block |
||
| 98 | 98 | $builder->whereIn('model_type', $types); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - return $builder->get()->mapToGroups(function ($record) { |
|
| 101 | + return $builder->get()->mapToGroups(function($record) { |
|
| 102 | 102 | return [$record->model_type => $record->model_id]; |
| 103 | - })->map(function ($record, $key) { |
|
| 103 | + })->map(function($record, $key) { |
|
| 104 | 104 | return Morphables::instance($key)->find($record->toArray()); |
| 105 | - })->map->reject(function ($model) use ($online) { |
|
| 105 | + })->map->reject(function($model) use ($online) { |
|
| 106 | 106 | if ($online) { |
| 107 | 107 | return is_null($model) || !$model->isPublished(); |
| 108 | 108 | } // Invalid references to archived or removed models where url record still exists. |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | }); |
| 113 | 113 | |
| 114 | 114 | if ($ignoredModel) { |
| 115 | - $models = $models->reject(function ($model) use ($ignoredModel) { |
|
| 115 | + $models = $models->reject(function($model) use ($ignoredModel) { |
|
| 116 | 116 | return (get_class($model) === get_class($ignoredModel) && $model->id === $ignoredModel->id); |
| 117 | 117 | }); |
| 118 | 118 | } |