@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | return static::$view; |
202 | 202 | } |
203 | 203 | |
204 | - return 'flare::'.static::$view; |
|
204 | + return 'flare::' . static::$view; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public static function relativeUrl($path = '') |
309 | 309 | { |
310 | - return \Flare::relativeAdminUrl(static::urlPrefix().($path ? '/'.$path : '')); |
|
310 | + return \Flare::relativeAdminUrl(static::urlPrefix() . ($path ? '/' . $path : '')); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | */ |
332 | 332 | public static function relativeCurrentUrl($path) |
333 | 333 | { |
334 | - return \Route::current() ? \Route::current()->getPrefix().'/'.$path : null; |
|
334 | + return \Route::current() ? \Route::current()->getPrefix() . '/' . $path : null; |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function renderAdd() |
74 | 74 | { |
75 | - return view($this->viewpath.'.add', []); |
|
75 | + return view($this->viewpath . '.add', []); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function renderEdit() |
84 | 84 | { |
85 | - return view($this->viewpath.'.edit', []); |
|
85 | + return view($this->viewpath . '.edit', []); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function renderView() |
94 | 94 | { |
95 | - return view($this->viewpath.'.view', []); |
|
95 | + return view($this->viewpath . '.view', []); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -122,10 +122,10 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function getFieldOptions() |
124 | 124 | { |
125 | - if (method_exists($this->getModelManager(), $method = camel_case('get_'.$this->getAttribute().'_options'))) { |
|
125 | + if (method_exists($this->getModelManager(), $method = camel_case('get_' . $this->getAttribute() . '_options'))) { |
|
126 | 126 | // First check for a method of options based on getAttributeNameOptions() |
127 | 127 | $this->field['options'] = $this->getModelManager()->$method(); |
128 | - } elseif (isset($this->field['options']) && is_string($this->field['options']) && method_exists($this->getModelManager(), $method = camel_case('get_'.$this->field['options'].'_options'))) { |
|
128 | + } elseif (isset($this->field['options']) && is_string($this->field['options']) && method_exists($this->getModelManager(), $method = camel_case('get_' . $this->field['options'] . '_options'))) { |
|
129 | 129 | // Check if Options is a string and if so, check for a method |
130 | 130 | // of options based on getDefinedOptions() |
131 | 131 | $this->field['options'] = $this->getModelManager()->$method(); |
@@ -31,16 +31,16 @@ |
||
31 | 31 | return static::$view; |
32 | 32 | } |
33 | 33 | |
34 | - if (view()->exists('admin.menus.'.static::location().'.widget')) { |
|
35 | - return 'admin.'.static::safeTitle().'.widget'; |
|
34 | + if (view()->exists('admin.menus.' . static::location() . '.widget')) { |
|
35 | + return 'admin.' . static::safeTitle() . '.widget'; |
|
36 | 36 | } |
37 | 37 | |
38 | - if (view()->exists('admin.menus.'.static::safeTitle())) { |
|
39 | - return 'admin.menus.'.static::safeTitle(); |
|
38 | + if (view()->exists('admin.menus.' . static::safeTitle())) { |
|
39 | + return 'admin.menus.' . static::safeTitle(); |
|
40 | 40 | } |
41 | 41 | |
42 | - if (view()->exists('flare::'.self::$view)) { |
|
43 | - return 'flare::'.self::$view; |
|
42 | + if (view()->exists('flare::' . self::$view)) { |
|
43 | + return 'flare::' . self::$view; |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | if (($methodBreaker = strpos($field, '.')) !== false) { |
143 | 143 | $method = substr($field, 0, $methodBreaker); |
144 | 144 | if (method_exists($this->model, $method)) { |
145 | - if (method_exists($this->model->$method(), $submethod = str_replace($method.'.', '', $field))) { |
|
145 | + if (method_exists($this->model->$method(), $submethod = str_replace($method . '.', '', $field))) { |
|
146 | 146 | $this->model->$method()->$submethod(); |
147 | 147 | |
148 | 148 | $columns[$field] = $fieldTitle; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | if ($this->hasGetAccessor($key)) { |
185 | - $method = 'get'.Str::studly($key).'Attribute'; |
|
185 | + $method = 'get' . Str::studly($key) . 'Attribute'; |
|
186 | 186 | |
187 | 187 | return $this->{$method}($model); |
188 | 188 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function hasGetAccessor($key) |
205 | 205 | { |
206 | - return method_exists($this, 'get'.Str::studly($key).'Attribute'); |
|
206 | + return method_exists($this, 'get' . Str::studly($key) . 'Attribute'); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | if (($methodBreaker = strpos($key, '.')) !== false) { |
249 | 249 | $method = substr($key, 0, $methodBreaker); |
250 | 250 | if (method_exists($model, $method)) { |
251 | - if (method_exists($model->$method, $submethod = str_replace($method.'.', '', $key))) { |
|
251 | + if (method_exists($model->$method, $submethod = str_replace($method . '.', '', $key))) { |
|
252 | 252 | return $model->$method->$submethod(); |
253 | 253 | } |
254 | 254 | |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | public function setAttribute($key, $value) |
273 | 273 | { |
274 | 274 | if ($this->hasSetMutator($key)) { |
275 | - $method = 'set'.Str::studly($key).'Attribute'; |
|
275 | + $method = 'set' . Str::studly($key) . 'Attribute'; |
|
276 | 276 | |
277 | 277 | return $this->{$method}($value); |
278 | 278 | } |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | */ |
290 | 290 | public function hasSetMutator($key) |
291 | 291 | { |
292 | - return method_exists($this, 'set'.Str::studly($key).'Attribute'); |
|
292 | + return method_exists($this, 'set' . Str::studly($key) . 'Attribute'); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | { |
118 | 118 | $this->modelAdmin->create(); |
119 | 119 | |
120 | - return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->title().' was successfully created.', 'dismissable' => false]]); |
|
120 | + return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->title() . ' was successfully created.', 'dismissable' => false]]); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | { |
160 | 160 | $this->modelAdmin->edit($modelitem_id); |
161 | 161 | |
162 | - return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->title().' was successfully updated.', 'dismissable' => false]]); |
|
162 | + return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->title() . ' was successfully updated.', 'dismissable' => false]]); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | { |
192 | 192 | $this->modelAdmin->delete($modelitem_id); |
193 | 193 | |
194 | - return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->title().' was successfully removed.', 'dismissable' => false]]); |
|
194 | + return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->title() . ' was successfully removed.', 'dismissable' => false]]); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | { |
218 | 218 | $this->modelAdmin->findOnlyTrashed($modelitem_id)->restore(); |
219 | 219 | |
220 | - return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->title().' was successfully restored.', 'dismissable' => false]]); |
|
220 | + return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->title() . ' was successfully restored.', 'dismissable' => false]]); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |
@@ -231,6 +231,6 @@ discard block |
||
231 | 231 | { |
232 | 232 | $this->modelAdmin->find($modelitem_id)->replicate($this->modelAdmin->excludeOnClone())->save(); |
233 | 233 | |
234 | - return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The '.$this->modelAdmin->title().' was successfully cloned.', 'dismissable' => false]]); |
|
234 | + return redirect($this->modelAdmin->currentUrl())->with('notifications_below_header', [['type' => 'success', 'icon' => 'check-circle', 'title' => 'Success!', 'message' => 'The ' . $this->modelAdmin->title() . ' was successfully cloned.', 'dismissable' => false]]); |
|
235 | 235 | } |
236 | 236 | } |
@@ -40,16 +40,16 @@ |
||
40 | 40 | return static::$view; |
41 | 41 | } |
42 | 42 | |
43 | - if (view()->exists('admin.'.static::urlPrefix().'.index')) { |
|
44 | - return 'admin.'.static::urlPrefix().'.index'; |
|
43 | + if (view()->exists('admin.' . static::urlPrefix() . '.index')) { |
|
44 | + return 'admin.' . static::urlPrefix() . '.index'; |
|
45 | 45 | } |
46 | 46 | |
47 | - if (view()->exists('admin.'.static::urlPrefix())) { |
|
48 | - return 'admin.'.static::urlPrefix(); |
|
47 | + if (view()->exists('admin.' . static::urlPrefix())) { |
|
48 | + return 'admin.' . static::urlPrefix(); |
|
49 | 49 | } |
50 | 50 | |
51 | - if (view()->exists('flare::'.self::$view)) { |
|
52 | - return 'flare::'.self::$view; |
|
51 | + if (view()->exists('flare::' . self::$view)) { |
|
52 | + return 'flare::' . self::$view; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | return parent::getView(); |
@@ -50,8 +50,6 @@ |
||
50 | 50 | $this->viewData['bgColour'] = $this->bgColours[self::$counter]; |
51 | 51 | $this->viewData['pluralTitle'] = $modelAdmin::pluralTitle(); |
52 | 52 | $this->viewData['modelTotal'] = $modelAdmin->model()->count(); |
53 | - $this->viewData['icon'] = $modelAdmin::getIcon(); |
|
54 | - |
|
55 | - ++self::$counter; |
|
53 | + $this->viewData['icon'] = $modelAdmin::getIcon();++self::$counter; |
|
56 | 54 | } |
57 | 55 | } |
@@ -49,20 +49,20 @@ |
||
49 | 49 | return static::$view; |
50 | 50 | } |
51 | 51 | |
52 | - if (view()->exists('admin.widgets.'.static::safeTitle().'.widget')) { |
|
53 | - return 'admin.widgets.'.static::safeTitle().'.widget'; |
|
52 | + if (view()->exists('admin.widgets.' . static::safeTitle() . '.widget')) { |
|
53 | + return 'admin.widgets.' . static::safeTitle() . '.widget'; |
|
54 | 54 | } |
55 | 55 | |
56 | - if (view()->exists('admin.widgets.'.static::safeTitle())) { |
|
57 | - return 'admin.widgets.'.static::safeTitle(); |
|
56 | + if (view()->exists('admin.widgets.' . static::safeTitle())) { |
|
57 | + return 'admin.widgets.' . static::safeTitle(); |
|
58 | 58 | } |
59 | 59 | |
60 | - if (view()->exists('admin.'.static::safeTitle())) { |
|
61 | - return 'admin.'.static::safeTitle(); |
|
60 | + if (view()->exists('admin.' . static::safeTitle())) { |
|
61 | + return 'admin.' . static::safeTitle(); |
|
62 | 62 | } |
63 | 63 | |
64 | - if (view()->exists('flare::'.self::$view)) { |
|
65 | - return 'flare::'.self::$view; |
|
64 | + if (view()->exists('flare::' . self::$view)) { |
|
65 | + return 'flare::' . self::$view; |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected function getStub() |
44 | 44 | { |
45 | - return __DIR__.'/../../stubs/model-admin-controller.stub'; |
|
45 | + return __DIR__ . '/../../stubs/model-admin-controller.stub'; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -54,6 +54,6 @@ discard block |
||
54 | 54 | */ |
55 | 55 | protected function getDefaultNamespace($rootNamespace) |
56 | 56 | { |
57 | - return $rootNamespace.'\Admin\\Http\\Controllers'; |
|
57 | + return $rootNamespace . '\Admin\\Http\\Controllers'; |
|
58 | 58 | } |
59 | 59 | } |