@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | trait HasPageSelect |
| 8 | 8 | { |
| 9 | - public function pageLink($column, $locale = null){ |
|
| 9 | + public function pageLink($column, $locale = null) { |
|
| 10 | 10 | return FlatReferenceFactory::fromString($this->$column)->instance()->url($locale ?? app()->getLocale()); |
| 11 | 11 | } |
| 12 | 12 | } |
@@ -6,18 +6,18 @@ discard block |
||
| 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 MEDIA = 'media'; // media file (slim uploader) |
|
| 18 | - const DOCUMENT = 'document'; // documents |
|
| 19 | - const RADIO = 'radio'; // media file (slim uploader) |
|
| 20 | - 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 MEDIA = 'media'; // media file (slim uploader) |
|
| 18 | + const DOCUMENT = 'document'; // documents |
|
| 19 | + const RADIO = 'radio'; // media file (slim uploader) |
|
| 20 | + const PAGEBUILDER = 'pagebuilder'; // the most special field there is... |
|
| 21 | 21 | const PAGE = 'select'; // select a page (also a special field) |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | static::PAGEBUILDER, |
| 43 | 43 | static::PAGE |
| 44 | 44 | ])) { |
| 45 | - throw new \Exception('Invalid type identifier given [' . $type . '].'); |
|
| 45 | + throw new \Exception('Invalid type identifier given ['.$type.'].'); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | $this->type = $type; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public static function fromString(string $type) |
| 52 | 52 | { |
| 53 | - $class = 'Thinktomorrow\Chief\Fields\Types\\' . ucfirst($type . 'Field'); |
|
| 53 | + $class = 'Thinktomorrow\Chief\Fields\Types\\'.ucfirst($type.'Field'); |
|
| 54 | 54 | |
| 55 | 55 | return new $class(new static($type)); |
| 56 | 56 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Thinktomorrow\Chief\Fields\Types; |
| 5 | 5 | |
@@ -16,13 +16,13 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | public function options(array $morphKeys = []) |
| 18 | 18 | { |
| 19 | - $morphKeys = collect($morphKeys)->map(function($key){ |
|
| 19 | + $morphKeys = collect($morphKeys)->map(function($key) { |
|
| 20 | 20 | return (new $key)->getMorphClass(); |
| 21 | 21 | }); |
| 22 | 22 | |
| 23 | - if( ! $morphKeys->isEmpty()) { |
|
| 23 | + if (!$morphKeys->isEmpty()) { |
|
| 24 | 24 | $pages = Page::whereIn('morph_key', $morphKeys)->get(); |
| 25 | - } else { |
|
| 25 | + }else { |
|
| 26 | 26 | $pages = Page::all(); |
| 27 | 27 | } |
| 28 | 28 | |