@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | foreach ($this->children as $i => $child) { |
71 | 71 | |
72 | 72 | // Do not render offline relations |
73 | - if($child->relation->isOffline()) continue; |
|
73 | + if ($child->relation->isOffline()) continue; |
|
74 | 74 | |
75 | 75 | if ($child instanceof StoredSetReference) { |
76 | 76 | $this->addSetToCollection($i, $child->toSet($this->parent)); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $this->addModelToCollection($i, $child); |
96 | 96 | } |
97 | 97 | |
98 | - return $this->sets->values()->map(function (ViewableContract $child) { |
|
98 | + return $this->sets->values()->map(function(ViewableContract $child) { |
|
99 | 99 | return ($this->withSnippets && method_exists($child, 'withSnippets')) |
100 | 100 | ? $child->withSnippets()->setViewParent($this->parent)->renderView() |
101 | 101 | : $child->setViewParent($this->parent)->renderView(); |
@@ -70,7 +70,9 @@ |
||
70 | 70 | foreach ($this->children as $i => $child) { |
71 | 71 | |
72 | 72 | // Do not render offline relations |
73 | - if($child->relation->isOffline()) continue; |
|
73 | + if($child->relation->isOffline()) { |
|
74 | + continue; |
|
75 | + } |
|
74 | 76 | |
75 | 77 | if ($child instanceof StoredSetReference) { |
76 | 78 | $this->addSetToCollection($i, $child->toSet($this->parent)); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | $availableChildren = AvailableChildren::forParent($model); |
51 | 51 | |
52 | - $modules = $availableChildren->onlyModules()->reject(function ($module) use ($model) { |
|
52 | + $modules = $availableChildren->onlyModules()->reject(function($module) use ($model) { |
|
53 | 53 | return $module->owner_id != null && $module->owner_id != $model->id; |
54 | 54 | }); |
55 | 55 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $available_sets = FlatReferencePresenter::toGroupedSelectValues($availableChildren->onlySets())->toArray(); |
59 | 59 | |
60 | 60 | // Current sections |
61 | - $sections = $model->children()->map(function ($section, $index) use($model) { |
|
61 | + $sections = $model->children()->map(function($section, $index) use($model) { |
|
62 | 62 | if ($section instanceof TranslatableContract) { |
63 | 63 | $section->injectTranslationForForm(); |
64 | 64 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | public static function fromRequest() |
19 | 19 | { |
20 | - if(!config('thinktomorrow.chief.preview-mode') || Str::startsWith(request()->path(), 'admin/')) { |
|
20 | + if (!config('thinktomorrow.chief.preview-mode') || Str::startsWith(request()->path(), 'admin/')) { |
|
21 | 21 | return new static(false); |
22 | 22 | } |
23 | 23 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | $mode = config('thinktomorrow.chief.preview-mode'); |
42 | 42 | |
43 | - if(!$mode || $mode == 'live') return false; |
|
43 | + if (!$mode || $mode == 'live') return false; |
|
44 | 44 | |
45 | 45 | return ($mode == 'preview'); |
46 | 46 | } |
@@ -40,7 +40,9 @@ |
||
40 | 40 | { |
41 | 41 | $mode = config('thinktomorrow.chief.preview-mode'); |
42 | 42 | |
43 | - if(!$mode || $mode == 'live') return false; |
|
43 | + if(!$mode || $mode == 'live') { |
|
44 | + return false; |
|
45 | + } |
|
44 | 46 | |
45 | 47 | return ($mode == 'preview'); |
46 | 48 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $this->pageBuilderField(), |
84 | 84 | InputField::make('title')->translatable($this->model->availableLocales()) |
85 | 85 | ->validation('required-fallback-locale|max:200', [], [ |
86 | - 'trans.' . config('app.fallback_locale', 'nl') . '.title' => 'title', |
|
86 | + 'trans.'.config('app.fallback_locale', 'nl').'.title' => 'title', |
|
87 | 87 | ]) |
88 | 88 | ->label('Intern label') |
89 | 89 | ->description('Dit is de benaming die zal worden getoond in de admin selectie velden.') |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | $this->model->morph_key = $this->model->morphKey(); |
153 | 153 | } |
154 | 154 | |
155 | - if($this->isManualSortable() && !$request->has('order')) { |
|
156 | - $this->model->order = $this->modelInstance()::orderBy('order', 'desc')->first()->order + 1; |
|
155 | + if ($this->isManualSortable() && !$request->has('order')) { |
|
156 | + $this->model->order = $this->modelInstance()::orderBy('order', 'desc')->first()->order+1; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | parent::saveFields($request, $this->createFields()->merge($this->fieldsWithAssistantFields()->keyed('url-slugs'))); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | if (is_array_empty($translation)) { |
213 | 213 | |
214 | 214 | // Nullify all values |
215 | - $trans[$locale] = array_map(function ($value) { |
|
215 | + $trans[$locale] = array_map(function($value) { |
|
216 | 216 | return null; |
217 | 217 | }, $translation); |
218 | 218 | continue; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $params = []; |
23 | 23 | |
24 | 24 | foreach ($indices as $index => $modelId) { |
25 | - $id = (int) $modelId; |
|
25 | + $id = (int)$modelId; |
|
26 | 26 | $cases[] = "WHEN {$id} then ?"; |
27 | 27 | $params[] = $index; |
28 | 28 | $ids[] = $id; |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | |
79 | 79 | public function saveCreateFields(Request $request): void |
80 | 80 | { |
81 | - if($this->isManualSortable() && !$request->has('order')) { |
|
82 | - $this->model->order = $this->modelInstance()::orderBy('order', 'desc')->first()->order + 1; |
|
81 | + if ($this->isManualSortable() && !$request->has('order')) { |
|
82 | + $this->model->order = $this->modelInstance()::orderBy('order', 'desc')->first()->order+1; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | $this->saveFields($request, $this->createFields()); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | return $this->indexPagination($builder); |
107 | 107 | } |
108 | 108 | |
109 | - return $builder->get()->map(function ($model) { |
|
109 | + return $builder->get()->map(function($model) { |
|
110 | 110 | return (new static($this->registration))->manage($model); |
111 | 111 | }); |
112 | 112 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | protected function indexSorting(Builder $builder): Builder |
120 | 120 | { |
121 | - if($this->isManualSortable()) { |
|
121 | + if ($this->isManualSortable()) { |
|
122 | 122 | $builder->sortedManually(); |
123 | 123 | } |
124 | 124 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | { |
139 | 139 | $paginator = $builder->paginate($this->pageCount); |
140 | 140 | |
141 | - $modifiedCollection = $builder->paginate($this->pageCount)->getCollection()->transform(function ($model) { |
|
141 | + $modifiedCollection = $builder->paginate($this->pageCount)->getCollection()->transform(function($model) { |
|
142 | 142 | return (new static($this->registration))->manage($model); |
143 | 143 | }); |
144 | 144 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | { |
262 | 262 | $fields = $this->fieldsWithAssistantFields(); |
263 | 263 | |
264 | - if($this->isManualSortable() && !$fields->offsetExists('order')) { |
|
264 | + if ($this->isManualSortable() && !$fields->offsetExists('order')) { |
|
265 | 265 | $fields = $fields->add(NumberField::make('order')); |
266 | 266 | } |
267 | 267 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | |
271 | 271 | public function editFields(): Fields |
272 | 272 | { |
273 | - return $this->fieldsWithAssistantFields()->map(function (Field $field) { |
|
273 | + return $this->fieldsWithAssistantFields()->map(function(Field $field) { |
|
274 | 274 | return $field->model($this->model); |
275 | 275 | }); |
276 | 276 | } |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | static::$bootedTraitMethods[$baseMethod] = []; |
364 | 364 | |
365 | 365 | foreach (class_uses_recursive($class) as $trait) { |
366 | - $method = class_basename($trait) . ucfirst($baseMethod); |
|
366 | + $method = class_basename($trait).ucfirst($baseMethod); |
|
367 | 367 | |
368 | 368 | if (method_exists($class, $method) && !in_array($method, static::$bootedTraitMethods[$baseMethod])) { |
369 | 369 | static::$bootedTraitMethods[$baseMethod][] = lcfirst($method); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | app($notifier)->onFailure($checkInstance); |
34 | 34 | } |
35 | 35 | break; |
36 | - } else { |
|
36 | + }else { |
|
37 | 37 | foreach ($notifiers as $notifier) { |
38 | 38 | app($notifier)->onSuccess($checkInstance); |
39 | 39 | } |