@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | protected function getStub() |
| 44 | 44 | { |
| 45 | - return __DIR__.'/../../stubs/module-admin-controller.stub'; |
|
| 45 | + return __DIR__ . '/../../stubs/module-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 | } |
@@ -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())]); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | /** |
| 75 | 75 | * Log the user. |
| 76 | 76 | * |
| 77 | - * @return \Illuminate\Http\RedirectReponse |
|
| 77 | + * @return \Illuminate\Http\RedirectResponse |
|
| 78 | 78 | */ |
| 79 | 79 | public function getLogout() |
| 80 | 80 | { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * panel.If they do no, they will be sent |
| 118 | 118 | * to the homepage of the website. |
| 119 | 119 | * |
| 120 | - * @return \Illuminate\Http\RedirectReponse |
|
| 120 | + * @return \Illuminate\Http\RedirectResponse |
|
| 121 | 121 | */ |
| 122 | 122 | protected function loginRedirect() |
| 123 | 123 | { |
@@ -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,19 +29,19 @@ 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 |
| 40 | 40 | $sql_details = array( |
| 41 | - 'user' => '', |
|
| 42 | - 'pass' => '', |
|
| 43 | - 'db' => '', |
|
| 44 | - 'host' => '' |
|
| 41 | + 'user' => '', |
|
| 42 | + 'pass' => '', |
|
| 43 | + 'db' => '', |
|
| 44 | + 'host' => '' |
|
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | |
@@ -53,6 +53,6 @@ discard block |
||
| 53 | 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 | |
@@ -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 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | public function config($key) |
| 54 | 54 | { |
| 55 | 55 | if (array_key_exists($key, $this->configurationKeys)) { |
| 56 | - return config('flare.'.$key, $this->configurationKeys[$key]); |
|
| 56 | + return config('flare.' . $key, $this->configurationKeys[$key]); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | return config($key); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function relativeAdminUrl($path = '') |
| 105 | 105 | { |
| 106 | - return rtrim(\Flare::config('admin_url').'/'.$path, '/'); |
|
| 106 | + return rtrim(\Flare::config('admin_url') . '/' . $path, '/'); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function docsUrl($path = '') |
| 118 | 118 | { |
| 119 | - return url('#'.$path); |
|
| 119 | + return url('#' . $path); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -171,10 +171,10 @@ discard block |
||
| 171 | 171 | if ($this->attributeTypeExists($field['type'])) { |
| 172 | 172 | $fieldType = $this->resolveAttributeClass($field['type']); |
| 173 | 173 | |
| 174 | - return call_user_func_array([new $fieldType($attribute, $field, $model, $modelManager), camel_case('render_'.$action)], []); |
|
| 174 | + return call_user_func_array([new $fieldType($attribute, $field, $model, $modelManager), camel_case('render_' . $action)], []); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - return call_user_func_array([new BaseAttribute($attribute, $field, $model, $modelManager), camel_case('render_'.$action)], []); |
|
| 177 | + return call_user_func_array([new BaseAttribute($attribute, $field, $model, $modelManager), camel_case('render_' . $action)], []); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | */ |
| 187 | 187 | protected function resolveAttributeClass($type) |
| 188 | 188 | { |
| 189 | - $fullClassname = array_key_exists(title_case($type).'Attribute', $this->availableAttributes()) ? $this->availableAttributes()[title_case($type).'Attribute'] : false; |
|
| 189 | + $fullClassname = array_key_exists(title_case($type) . 'Attribute', $this->availableAttributes()) ? $this->availableAttributes()[title_case($type) . 'Attribute'] : false; |
|
| 190 | 190 | |
| 191 | 191 | if (!$fullClassname || !class_exists($fullClassname)) { |
| 192 | 192 | return false; |
@@ -314,7 +314,6 @@ |
||
| 314 | 314 | /** |
| 315 | 315 | * Determine if the Model Admin is sortable in it's list view. |
| 316 | 316 | * |
| 317 | - * @param string $key |
|
| 318 | 317 | * |
| 319 | 318 | * @return bool |
| 320 | 319 | */ |
@@ -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 | /** |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace LaravelFlare\Flare\Providers; |
| 4 | 4 | |
| 5 | -use Route; |
|
| 6 | 5 | use Illuminate\Routing\Router; |
| 7 | 6 | use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; |
| 8 | 7 | |