@@ -55,7 +55,7 @@ |
||
55 | 55 | public function fragmentsIndex(string $ownerClass, $ownerId) |
56 | 56 | { |
57 | 57 | // trap($ownerClass, $ownerId); |
58 | - $models = static::managedModelClass()::whereIn('id',[2,3])->get(); |
|
58 | + $models = static::managedModelClass()::whereIn('id', [2, 3])->get(); |
|
59 | 59 | |
60 | 60 | return view('chief::back.catalogpages._fragments', [ |
61 | 61 | 'models' => $models, |
@@ -153,7 +153,7 @@ |
||
153 | 153 | 'fields' => $model->fields()->map(function (Field $field) use ($model) { |
154 | 154 | // TODO refactor so render method of field takes model and managerViewModel as arguments. |
155 | 155 | return $field->model($model) |
156 | - ->viewData(['managerViewModel' => new managerViewModel($this)]); |
|
156 | + ->viewData(['managerViewModel' => new managerViewModel($this)]); |
|
157 | 157 | }), |
158 | 158 | ]); |
159 | 159 | } |
@@ -95,15 +95,15 @@ discard block |
||
95 | 95 | // Default sorted by publish date |
96 | 96 | $modelClass = static::managedModelClass(); |
97 | 97 | if (Schema::hasColumn((new $modelClass)->getTable(), 'published_at')) { |
98 | - $filters = $filters->add(HiddenFilter::make('publish', function($query){ |
|
99 | - return $query->orderBy('published_at','DESC'); |
|
98 | + $filters = $filters->add(HiddenFilter::make('publish', function($query) { |
|
99 | + return $query->orderBy('published_at', 'DESC'); |
|
100 | 100 | })); |
101 | 101 | } |
102 | 102 | |
103 | 103 | // if model has no timestamps, updated_at doesn't exist |
104 | 104 | if ((new $modelClass)->timestamps) { |
105 | - $filters = $filters->add(HiddenFilter::make('updated', function($query){ |
|
106 | - return $query->orderBy('updated_at','DESC'); |
|
105 | + $filters = $filters->add(HiddenFilter::make('updated', function($query) { |
|
106 | + return $query->orderBy('updated_at', 'DESC'); |
|
107 | 107 | })); |
108 | 108 | } |
109 | 109 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $model->saveFields($model->fields()->tagged('create'), $request->all(), $request->allFiles()); |
135 | 135 | |
136 | 136 | return redirect()->to($this->route('edit', $model)) |
137 | - ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i> "' . $model->adminLabel('title') . '" is toegevoegd'); |
|
137 | + ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i> "'.$model->adminLabel('title').'" is toegevoegd'); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | public function edit($id) |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | return view('chief::back.managers.edit', [ |
150 | 150 | 'manager' => $this, |
151 | 151 | 'model' => $model, |
152 | - 'fields' => $model->fields()->map(function (Field $field) use ($model) { |
|
152 | + 'fields' => $model->fields()->map(function(Field $field) use ($model) { |
|
153 | 153 | // TODO refactor so render method of field takes model and managerViewModel as arguments. |
154 | 154 | return $field->model($model) |
155 | 155 | ->viewData(['managerViewModel' => new managerViewModel($this)]); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $model->saveFields($model->fields(), $request->all(), $request->allFiles()); |
170 | 170 | |
171 | 171 | return redirect()->to($this->route('index')) |
172 | - ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i> <a href="'. $this->route('edit',$model) .'">' . $model->adminLabel('title') . '</a> is aangepast'); |
|
172 | + ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i> <a href="'.$this->route('edit', $model).'">'.$model->adminLabel('title').'</a> is aangepast'); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | public function delete($id, Request $request) |
@@ -179,12 +179,12 @@ discard block |
||
179 | 179 | $model = static::managedModelClass()::findOrFail($id); |
180 | 180 | |
181 | 181 | if ($request->get('deleteconfirmation') !== 'DELETE') { |
182 | - return redirect()->back()->with('messages.warning', $model->adminLabel('title') . ' is niet verwijderd.'); |
|
182 | + return redirect()->back()->with('messages.warning', $model->adminLabel('title').' is niet verwijderd.'); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | app(DeleteManagedModel::class)->handle($model); |
186 | 186 | |
187 | 187 | return redirect()->to($this->route('index')) |
188 | - ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i> "' . $model->adminLabel('title') . '" is verwijderd.'); |
|
188 | + ->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i> "'.$model->adminLabel('title').'" is verwijderd.'); |
|
189 | 189 | } |
190 | 190 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | public function tagged($tags): self |
16 | 16 | { |
17 | - $tags = (array) $tags; |
|
17 | + $tags = (array)$tags; |
|
18 | 18 | |
19 | 19 | return $this->filter(function($value, $key) use($tags){ |
20 | 20 | return count(array_intersect($value, $tags)) > 0; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | public function notTagged($tags): self |
25 | 25 | { |
26 | - $tags = (array) $tags; |
|
26 | + $tags = (array)$tags; |
|
27 | 27 | |
28 | 28 | return $this->filter(function($value, $key) use($tags){ |
29 | 29 | return count(array_intersect($value, $tags)) === 0; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | public function untagged($tags): self |
34 | 34 | { |
35 | - $tags = (array) $tags; |
|
35 | + $tags = (array)$tags; |
|
36 | 36 | |
37 | 37 | return $this->filter(function($value, $key) use($tags){ |
38 | 38 | return empty($value); |
@@ -29,6 +29,6 @@ |
||
29 | 29 | ); |
30 | 30 | |
31 | 31 | $this->container->make(ModelToManagerMap::class)->map($class::managedModelClass(), $class); |
32 | - $this->container->make(RegisteredManagers::class)->tag($class, (array) $tags); |
|
32 | + $this->container->make(RegisteredManagers::class)->tag($class, (array)$tags); |
|
33 | 33 | } |
34 | 34 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | public function push($managedRoutes): self |
36 | 36 | { |
37 | - return new static($this->managerClass, $this->name, array_merge($this->routes, (array) $managedRoutes)); |
|
37 | + return new static($this->managerClass, $this->name, array_merge($this->routes, (array)$managedRoutes)); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | public function getManagerClass(): string |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | { |
28 | 28 | $managedRoutes = $this->expandWithAssistantRoutes($managerClass, $managedRoutes); |
29 | 29 | |
30 | - $this->router->group(['prefix' => $this->routePrefix, 'middleware' => $this->routeMiddleware], function () use($managedRoutes) { |
|
31 | - foreach($managedRoutes as $route) { |
|
30 | + $this->router->group(['prefix' => $this->routePrefix, 'middleware' => $this->routeMiddleware], function() use($managedRoutes) { |
|
31 | + foreach ($managedRoutes as $route) { |
|
32 | 32 | $this->router->addRoute( |
33 | 33 | $route->method, |
34 | - $managedRoutes->getName() .'/'. $route->uri, |
|
34 | + $managedRoutes->getName().'/'.$route->uri, |
|
35 | 35 | [$managedRoutes->getManagerClass(), $route->action] |
36 | - )->name('chief.' . $managedRoutes->getName() . '.' . $route->action); |
|
36 | + )->name('chief.'.$managedRoutes->getName().'.'.$route->action); |
|
37 | 37 | } |
38 | 38 | }); |
39 | 39 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | - if(public_method_exists($managerClass, 'routes')) { |
|
50 | + if (public_method_exists($managerClass, 'routes')) { |
|
51 | 51 | $managedRoutes = $managedRoutes->push($managerClass::routes()); |
52 | 52 | } |
53 | 53 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | protected function viewData(): array |
30 | 30 | { |
31 | - return array_merge( parent::viewData(),[ |
|
31 | + return array_merge(parent::viewData(), [ |
|
32 | 32 | 'options' => $this->options, |
33 | 33 | ]); |
34 | 34 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | protected function viewData(): array |
38 | 38 | { |
39 | - return array_merge( parent::viewData(),[ |
|
39 | + return array_merge(parent::viewData(), [ |
|
40 | 40 | 'options' => $this->options, |
41 | 41 | 'multiple' => $this->multiple, |
42 | 42 | ]); |
@@ -6,9 +6,9 @@ |
||
6 | 6 | |
7 | 7 | class FilterType |
8 | 8 | { |
9 | - const HIDDEN = 'hidden'; // hidden input - default sorting or filtering without admin manipulation possible |
|
10 | - const INPUT = 'input'; // oneliner text (input) |
|
11 | - const SELECT = 'select'; // Select options |
|
9 | + const HIDDEN = 'hidden'; // hidden input - default sorting or filtering without admin manipulation possible |
|
10 | + const INPUT = 'input'; // oneliner text (input) |
|
11 | + const SELECT = 'select'; // Select options |
|
12 | 12 | const CHECKBOX = 'checkbox'; |
13 | 13 | const RADIO = 'radio'; |
14 | 14 | } |