@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | public static function fromKeys($keys) |
| 21 | 21 | { |
| 22 | - $keys = (array) $keys; |
|
| 22 | + $keys = (array)$keys; |
|
| 23 | 23 | $collection = collect(); |
| 24 | 24 | |
| 25 | 25 | /** @var Managers */ |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public static function fromTags($tags) |
| 35 | 35 | { |
| 36 | - $tags = (array) $tags; |
|
| 36 | + $tags = (array)$tags; |
|
| 37 | 37 | $collection = collect(); |
| 38 | 38 | |
| 39 | 39 | /** @var Managers */ |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | private static function fromManagers(Collection $collection) |
| 54 | 54 | { |
| 55 | - return new static(...$collection->reject(function ($manager) { |
|
| 55 | + return new static(...$collection->reject(function($manager) { |
|
| 56 | 56 | return !$manager->can('index'); |
| 57 | - })->map(function ($manager) { |
|
| 57 | + })->map(function($manager) { |
|
| 58 | 58 | return new NavItem($manager->details()->plural, $manager->route('index'), [ |
| 59 | 59 | 'key' => $manager->details()->key, |
| 60 | 60 | 'tags' => app(Register::class)->filterByKey($manager->details()->key)->first()->tags() |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | public function rejectKeys($keys) |
| 66 | 66 | { |
| 67 | - $keys = (array) $keys; |
|
| 67 | + $keys = (array)$keys; |
|
| 68 | 68 | |
| 69 | 69 | foreach ($this->items as $k => $item) { |
| 70 | 70 | if (in_array($item->details('key', ''), $keys)) { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | public function rejectTags($tags) |
| 79 | 79 | { |
| 80 | - $tags = (array) $tags; |
|
| 80 | + $tags = (array)$tags; |
|
| 81 | 81 | |
| 82 | 82 | foreach ($this->items as $k => $item) { |
| 83 | 83 | if (count(array_intersect($item->details('tags', []), $tags)) > 0) { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $output = ''; |
| 120 | 120 | |
| 121 | 121 | foreach ($this->items as $item) { |
| 122 | - $output .= '<a class="' . (isActiveUrl($item->url()) ? 'active' : '') . '" href="'.$item->url().'">'; |
|
| 122 | + $output .= '<a class="'.(isActiveUrl($item->url()) ? 'active' : '').'" href="'.$item->url().'">'; |
|
| 123 | 123 | $output .= $title ?? ucfirst($item->title()); |
| 124 | 124 | $output .= '</a>'; |
| 125 | 125 | } |
@@ -146,14 +146,14 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | $items = ''; |
| 148 | 148 | foreach ($this->items as $item) { |
| 149 | - $items .= '<a class="' . (isActiveUrl($item->url()) ? 'active' : '') . '" href="'.$item->url().'">'; |
|
| 149 | + $items .= '<a class="'.(isActiveUrl($item->url()) ? 'active' : '').'" href="'.$item->url().'">'; |
|
| 150 | 150 | $items .= $item->title(); |
| 151 | 151 | $items .= '</a>'; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | // Surround within vue dropdown |
| 155 | 155 | $output = '<dropdown>'; |
| 156 | - $output .= '<span class="center-y nav-item" slot="trigger" slot-scope="{ toggle, isActive }" @click="toggle">'. ($title ?? 'Collecties') .'</span>'; |
|
| 156 | + $output .= '<span class="center-y nav-item" slot="trigger" slot-scope="{ toggle, isActive }" @click="toggle">'.($title ?? 'Collecties').'</span>'; |
|
| 157 | 157 | $output .= '<div v-cloak class="dropdown-box inset-s">'; |
| 158 | 158 | $output .= $items; |
| 159 | 159 | $output .= '</div>'; |
@@ -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>' . $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>'.$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; |