@@ -61,15 +61,15 @@ discard block |
||
61 | 61 | { |
62 | 62 | $permission = 'update-page'; |
63 | 63 | |
64 | - if (in_array($verb, ['index','show'])) { |
|
64 | + if (in_array($verb, ['index', 'show'])) { |
|
65 | 65 | $permission = 'view-page'; |
66 | - } elseif (in_array($verb, ['create','store'])) { |
|
66 | + } elseif (in_array($verb, ['create', 'store'])) { |
|
67 | 67 | $permission = 'create-page'; |
68 | 68 | } elseif (in_array($verb, ['delete'])) { |
69 | 69 | $permission = 'delete-page'; |
70 | 70 | } |
71 | 71 | |
72 | - if (! auth()->guard('chief')->user()->hasPermissionTo($permission)) { |
|
72 | + if (!auth()->guard('chief')->user()->hasPermissionTo($permission)) { |
|
73 | 73 | throw NotAllowedManagerRoute::notAllowedPermission($permission, $this); |
74 | 74 | } |
75 | 75 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | public function fieldArrangement($key = null): FieldArrangement |
132 | 132 | { |
133 | 133 | if ($key == 'create') { |
134 | - return new FieldArrangement($this->fieldsWithAssistantFields()->filterBy(function ($field) { |
|
134 | + return new FieldArrangement($this->fieldsWithAssistantFields()->filterBy(function($field) { |
|
135 | 135 | return in_array($field->key, ['title']); |
136 | 136 | })); |
137 | 137 | } |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | if ($this->model->id) { |
154 | 154 | return parent::details() |
155 | 155 | ->set('title', ucfirst($this->model->title)) |
156 | - ->set('intro', 'Aangepast ' . $this->model->updated_at->format('d/m/Y H:i')) |
|
157 | - ->set('context', '<span class="inline-xs stack-s">' . $this->assistant('publish')->publicationStatusAsLabel() . '</span>'); |
|
156 | + ->set('intro', 'Aangepast '.$this->model->updated_at->format('d/m/Y H:i')) |
|
157 | + ->set('context', '<span class="inline-xs stack-s">'.$this->assistant('publish')->publicationStatusAsLabel().'</span>'); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | return parent::details(); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | public function saveFields(Request $request) |
164 | 164 | { |
165 | 165 | // Store the morph_key upon creation |
166 | - if ($this->model instanceof MorphableContract && ! $this->model->morph_key) { |
|
166 | + if ($this->model instanceof MorphableContract && !$this->model->morph_key) { |
|
167 | 167 | $this->model->morph_key = $this->model->morphKey(); |
168 | 168 | } |
169 | 169 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | if (is_array_empty($translation)) { |
209 | 209 | |
210 | 210 | // Nullify all values |
211 | - $trans[$locale] = array_map(function ($value) { |
|
211 | + $trans[$locale] = array_map(function($value) { |
|
212 | 212 | return null; |
213 | 213 | }, $translation); |
214 | 214 | continue; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | return static::$managedModelKey; |
68 | 68 | } |
69 | 69 | |
70 | - throw new \Exception('Missing required static property \'managedModelKey\' on ' . static::class. '.'); |
|
70 | + throw new \Exception('Missing required static property \'managedModelKey\' on '.static::class.'.'); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public static function availableForCreation(): Collection |
78 | 78 | { |
79 | - $managers = app(Managers::class)->findByTag('module')->filter(function ($manager) { |
|
79 | + $managers = app(Managers::class)->findByTag('module')->filter(function($manager) { |
|
80 | 80 | return $manager->can('create'); |
81 | - })->map(function ($manager) { |
|
81 | + })->map(function($manager) { |
|
82 | 82 | return $manager->details(); |
83 | 83 | }); |
84 | 84 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | public function nomadicCan($verb) |
10 | 10 | { |
11 | - if (in_array($verb, ['create', 'store', 'delete']) && ! auth()->guard('chief')->user()->hasRole('developer')) { |
|
11 | + if (in_array($verb, ['create', 'store', 'delete']) && !auth()->guard('chief')->user()->hasRole('developer')) { |
|
12 | 12 | throw NotAllowedManagerRoute::notAllowedVerb($verb, $this); |
13 | 13 | } |
14 | 14 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | $registrations = collect($this->register->filterByTag($tag)->all()); |
52 | 52 | |
53 | - return $registrations->map(function ($registration) { |
|
53 | + return $registrations->map(function($registration) { |
|
54 | 54 | return $this->instance($registration); |
55 | 55 | }); |
56 | 56 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | $registrations = collect($this->register->filterByTag($tag)->all()); |
67 | 67 | |
68 | - return $registrations->map(function ($registration) { |
|
68 | + return $registrations->map(function($registration) { |
|
69 | 69 | return $this->instance($registration)->details(); |
70 | 70 | }); |
71 | 71 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | //return array with group name and values |
77 | 77 | $grouped = []; |
78 | 78 | |
79 | - $managers = $managers->map(function (Manager $item) { |
|
79 | + $managers = $managers->map(function(Manager $item) { |
|
80 | 80 | return [ |
81 | 81 | 'id' => $item->details()->id, |
82 | 82 | 'group' => $item->details()->plural, |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | { |
91 | 91 | $registrations = collect($this->register->all()); |
92 | 92 | |
93 | - return $registrations->map(function ($registration) { |
|
93 | + return $registrations->map(function($registration) { |
|
94 | 94 | return $this->instance($registration); |
95 | 95 | }); |
96 | 96 | } |
97 | 97 | |
98 | 98 | public function anyRegisteredByTag($tag) |
99 | 99 | { |
100 | - return ! empty($this->register->filterByTag($tag)->all()); |
|
100 | + return !empty($this->register->filterByTag($tag)->all()); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | protected $pageCount = 20; |
39 | 39 | protected $paginated = true; |
40 | - protected static $booted = []; |
|
40 | + protected static $booted = []; |
|
41 | 41 | |
42 | 42 | public function __construct(Registration $registration) |
43 | 43 | { |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | return $this->indexPagination($builder); |
85 | 85 | } |
86 | 86 | |
87 | - return $builder->get()->map(function ($model) { |
|
87 | + return $builder->get()->map(function($model) { |
|
88 | 88 | return (new static($this->registration))->manage($model); |
89 | 89 | }); |
90 | 90 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | { |
113 | 113 | $paginator = $builder->paginate($this->pageCount); |
114 | 114 | |
115 | - $modifiedCollection = $builder->paginate($this->pageCount)->getCollection()->transform(function ($model) { |
|
115 | + $modifiedCollection = $builder->paginate($this->pageCount)->getCollection()->transform(function($model) { |
|
116 | 116 | return (new static($this->registration))->manage($model); |
117 | 117 | }); |
118 | 118 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | public function guard($verb): Manager |
188 | 188 | { |
189 | - if (! $this->can($verb)) { |
|
189 | + if (!$this->can($verb)) { |
|
190 | 190 | NotAllowedManagerRoute::notAllowedVerb($verb, $this); |
191 | 191 | } |
192 | 192 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $fields = $this->fields(); |
210 | 210 | |
211 | 211 | foreach ($this->assistants() as $assistant) { |
212 | - if (! method_exists($assistant, 'fields')) { |
|
212 | + if (!method_exists($assistant, 'fields')) { |
|
213 | 213 | continue; |
214 | 214 | } |
215 | 215 | |
@@ -291,9 +291,9 @@ discard block |
||
291 | 291 | static::$booted[$baseMethod] = []; |
292 | 292 | |
293 | 293 | foreach (class_uses_recursive($class) as $trait) { |
294 | - $method = class_basename($trait) . ucfirst($baseMethod); |
|
294 | + $method = class_basename($trait).ucfirst($baseMethod); |
|
295 | 295 | |
296 | - if (method_exists($class, $method) && ! in_array($method, static::$booted[$baseMethod])) { |
|
296 | + if (method_exists($class, $method) && !in_array($method, static::$booted[$baseMethod])) { |
|
297 | 297 | static::$booted[$baseMethod][] = lcfirst($method); |
298 | 298 | } |
299 | 299 | } |