@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected function getStub() |
44 | 44 | { |
45 | - return __DIR__.'/../../stubs/module-admin.stub'; |
|
45 | + return __DIR__ . '/../../stubs/module-admin.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\\Modules'; |
|
57 | + return $rootNamespace . '\Admin\\Modules'; |
|
58 | 58 | } |
59 | 59 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected function getStub() |
44 | 44 | { |
45 | - return __DIR__.'/../../stubs/widget-admin.stub'; |
|
45 | + return __DIR__ . '/../../stubs/widget-admin.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\\Widgets'; |
|
57 | + return $rootNamespace . '\Admin\\Widgets'; |
|
58 | 58 | } |
59 | 59 | } |
@@ -102,7 +102,7 @@ |
||
102 | 102 | $view = 'admin.dashboard'; |
103 | 103 | |
104 | 104 | if (!view()->exists($view)) { |
105 | - $view = 'flare::'.$view; |
|
105 | + $view = 'flare::' . $view; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | return view($view, ['widgetAdminManager' => (new WidgetAdminManager())]); |
@@ -170,8 +170,8 @@ |
||
170 | 170 | { |
171 | 171 | // Could swap this out for model -> getAttribute, then check if we have an attribute or a relation... getRelationValue() is helpful |
172 | 172 | if (method_exists($this->model, $key) && is_a(call_user_func_array([$this->model, $key], []), 'Illuminate\Database\Eloquent\Relations\Relation')) { |
173 | - foreach ($this->{$action.'Relations'} as $relationship => $method) { |
|
174 | - if (is_a(call_user_func_array([$this->model, $key], []), 'Illuminate\Database\Eloquent\Relations\\'.$relationship)) { |
|
173 | + foreach ($this->{$action . 'Relations'} as $relationship => $method) { |
|
174 | + if (is_a(call_user_func_array([$this->model, $key], []), 'Illuminate\Database\Eloquent\Relations\\' . $relationship)) { |
|
175 | 175 | $this->model->$key()->$method($value); |
176 | 176 | |
177 | 177 | return; |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | // parameter represents the DataTables column identifier. In this case simple |
30 | 30 | // indexes |
31 | 31 | $columns = array( |
32 | - array( 'db' => 'id', 'dt' => 0 ), |
|
33 | - array( 'db' => 'firstname', 'dt' => 1 ), |
|
34 | - array( 'db' => 'surname', 'dt' => 2 ), |
|
35 | - array( 'db' => 'zip', 'dt' => 3 ), |
|
36 | - array( 'db' => 'country', 'dt' => 4 ) |
|
32 | + array('db' => 'id', 'dt' => 0), |
|
33 | + array('db' => 'firstname', 'dt' => 1), |
|
34 | + array('db' => 'surname', 'dt' => 2), |
|
35 | + array('db' => 'zip', 'dt' => 3), |
|
36 | + array('db' => 'country', 'dt' => 4) |
|
37 | 37 | ); |
38 | 38 | |
39 | 39 | // SQL server connection information |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | * server-side, there is no need to edit below this line. |
51 | 51 | */ |
52 | 52 | |
53 | -require( '../../../../examples/server_side/scripts/ssp.class.php' ); |
|
53 | +require('../../../../examples/server_side/scripts/ssp.class.php'); |
|
54 | 54 | |
55 | 55 | echo json_encode( |
56 | - SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns ) |
|
56 | + SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns) |
|
57 | 57 | ); |
58 | 58 |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | if (($methodBreaker = strpos($field, '.')) !== false) { |
150 | 150 | $method = substr($field, 0, $methodBreaker); |
151 | 151 | if (method_exists($this->model, $method)) { |
152 | - if (method_exists($this->model->$method(), $submethod = str_replace($method.'.', '', $field))) { |
|
152 | + if (method_exists($this->model->$method(), $submethod = str_replace($method . '.', '', $field))) { |
|
153 | 153 | $this->model->$method()->$submethod(); |
154 | 154 | |
155 | 155 | $columns[$field] = $fieldTitle; |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | } |
190 | 190 | |
191 | 191 | if ($this->hasGetAccessor($key)) { |
192 | - $method = 'get'.Str::studly($key).'Attribute'; |
|
192 | + $method = 'get' . Str::studly($key) . 'Attribute'; |
|
193 | 193 | |
194 | 194 | return $this->{$method}($model); |
195 | 195 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | public function hasGetAccessor($key) |
212 | 212 | { |
213 | - return method_exists($this, 'get'.Str::studly($key).'Attribute'); |
|
213 | + return method_exists($this, 'get' . Str::studly($key) . 'Attribute'); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | if (($methodBreaker = strpos($key, '.')) !== false) { |
256 | 256 | $method = substr($key, 0, $methodBreaker); |
257 | 257 | if (method_exists($model, $method)) { |
258 | - if (method_exists($model->$method, $submethod = str_replace($method.'.', '', $key))) { |
|
258 | + if (method_exists($model->$method, $submethod = str_replace($method . '.', '', $key))) { |
|
259 | 259 | return $model->$method->$submethod(); |
260 | 260 | } |
261 | 261 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | public function setAttribute($key, $value) |
280 | 280 | { |
281 | 281 | if ($this->hasSetMutator($key)) { |
282 | - $method = 'set'.Str::studly($key).'Attribute'; |
|
282 | + $method = 'set' . Str::studly($key) . 'Attribute'; |
|
283 | 283 | |
284 | 284 | return $this->{$method}($value); |
285 | 285 | } |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | */ |
297 | 297 | public function hasSetMutator($key) |
298 | 298 | { |
299 | - return method_exists($this, 'set'.Str::studly($key).'Attribute'); |
|
299 | + return method_exists($this, 'set' . Str::studly($key) . 'Attribute'); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | */ |
309 | 309 | public function hasGetMutator($key) |
310 | 310 | { |
311 | - return method_exists($this, 'get'.Str::studly($key).'Attribute'); |
|
311 | + return method_exists($this, 'get' . Str::studly($key) . 'Attribute'); |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | /** |
@@ -61,7 +61,7 @@ |
||
61 | 61 | $router->group(['prefix' => \Flare::config('admin_url'), 'middleware' => ['flarebase']], function ($router) { |
62 | 62 | |
63 | 63 | // Needs replacing with implicit routes, as controller is deprecated as of 5.2 and will be removed in 5.3 |
64 | - $router->controller('/', $this->namespace.'\AdminController'); |
|
64 | + $router->controller('/', $this->namespace . '\AdminController'); |
|
65 | 65 | |
66 | 66 | }); |
67 | 67 | } |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | public function config($key) |
77 | 77 | { |
78 | 78 | if (array_key_exists($key, $this->configurationKeys)) { |
79 | - return config('flare.config.'.$key, $this->configurationKeys[$key]); |
|
79 | + return config('flare.config.' . $key, $this->configurationKeys[$key]); |
|
80 | 80 | } |
81 | 81 | |
82 | - return config('flare.'.$key); |
|
82 | + return config('flare.' . $key); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | public function relativeAdminUrl($path = '') |
173 | 173 | { |
174 | - return rtrim($this->getRelativeAdminUrl().'/'.$path, '/'); |
|
174 | + return rtrim($this->getRelativeAdminUrl() . '/' . $path, '/'); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function docsUrl($path = '') |
211 | 211 | { |
212 | - return url('#'.$path); |
|
212 | + return url('#' . $path); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
@@ -264,10 +264,10 @@ discard block |
||
264 | 264 | if ($this->attributeTypeExists($field['type'])) { |
265 | 265 | $fieldType = $this->resolveAttributeClass($field['type']); |
266 | 266 | |
267 | - return call_user_func_array([new $fieldType($attribute, $field, $model, $modelManager), camel_case('render_'.$action)], []); |
|
267 | + return call_user_func_array([new $fieldType($attribute, $field, $model, $modelManager), camel_case('render_' . $action)], []); |
|
268 | 268 | } |
269 | 269 | |
270 | - return call_user_func_array([new BaseAttribute($attribute, $field, $model, $modelManager), camel_case('render_'.$action)], []); |
|
270 | + return call_user_func_array([new BaseAttribute($attribute, $field, $model, $modelManager), camel_case('render_' . $action)], []); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | /** |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | */ |
280 | 280 | protected function resolveAttributeClass($type) |
281 | 281 | { |
282 | - $fullClassname = array_key_exists(title_case($type).'Attribute', $this->availableAttributes()) ? $this->availableAttributes()[title_case($type).'Attribute'] : false; |
|
282 | + $fullClassname = array_key_exists(title_case($type) . 'Attribute', $this->availableAttributes()) ? $this->availableAttributes()[title_case($type) . 'Attribute'] : false; |
|
283 | 283 | |
284 | 284 | if (!$fullClassname || !class_exists($fullClassname)) { |
285 | 285 | return false; |
@@ -149,6 +149,6 @@ |
||
149 | 149 | */ |
150 | 150 | private function basePath($filepath = false) |
151 | 151 | { |
152 | - return __DIR__.'/../' . $filepath; |
|
152 | + return __DIR__ . '/../' . $filepath; |
|
153 | 153 | } |
154 | 154 | } |