@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | public function show(int $id) |
| 107 | 107 | { |
| 108 | 108 | $model = $this->model::findOrFail($id); |
| 109 | - $commentColumns = array_filter($this->getColumnsFromTable($model->comments()->getRelated()), function ($type, $name) use ($model) { |
|
| 109 | + $commentColumns = array_filter($this->getColumnsFromTable($model->comments()->getRelated()), function($type, $name) use ($model) { |
|
| 110 | 110 | return !in_array($name, ['id', 'updated_at', $model->comments()->getForeignKeyName(), $model->comments()->getMorphType()]); |
| 111 | 111 | }, ARRAY_FILTER_USE_BOTH); |
| 112 | 112 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public function create(Request $request) |
| 155 | 155 | { |
| 156 | - $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function ($item) { |
|
| 156 | + $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function($item) { |
|
| 157 | 157 | return $item !== null; |
| 158 | 158 | }); |
| 159 | 159 | if (isset($inputs['password'])) { |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | public function update(Request $request, int $id) |
| 211 | 211 | { |
| 212 | 212 | $model = $this->model::findOrFail($id); |
| 213 | - $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function ($item) { |
|
| 213 | + $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function($item) { |
|
| 214 | 214 | return $item !== null; |
| 215 | 215 | }); |
| 216 | 216 | if (isset($inputs['password'])) { |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | try { |
| 289 | 289 | $methods = (new ReflectionClass($model))->getMethods(ReflectionMethod::IS_PUBLIC); |
| 290 | - foreach($methods as $method) { |
|
| 290 | + foreach ($methods as $method) { |
|
| 291 | 291 | if ( |
| 292 | 292 | $method->class != get_class($model) || |
| 293 | 293 | !empty($method->getParameters()) || |
@@ -372,8 +372,8 @@ discard block |
||
| 372 | 372 | */ |
| 373 | 373 | protected function getInputsWithFiles($request, $inputs) |
| 374 | 374 | { |
| 375 | - if (! empty($this->files)) { |
|
| 376 | - $files = array_filter($inputs, function ($item, $key) { |
|
| 375 | + if (!empty($this->files)) { |
|
| 376 | + $files = array_filter($inputs, function($item, $key) { |
|
| 377 | 377 | return in_array($key, $this->files) && $item instanceof UploadedFile; |
| 378 | 378 | }, ARRAY_FILTER_USE_BOTH); |
| 379 | 379 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | try { |
| 68 | 68 | foreach ($migrations as $migration) { |
| 69 | 69 | $fullPath = $this->createBaseMigration($migration); |
| 70 | - $this->files->put($fullPath, $this->files->get(__DIR__ . "/stubs/{$migration}.stub")); |
|
| 70 | + $this->files->put($fullPath, $this->files->get(__DIR__."/stubs/{$migration}.stub")); |
|
| 71 | 71 | } |
| 72 | 72 | $this->composer->dumpAutoloads(); |
| 73 | 73 | } catch (FileNotFoundException $exception) { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | protected function createAdminUser() |
| 93 | 93 | { |
| 94 | - if (! is_dir($directory = app_path('Admin'))) { |
|
| 94 | + if (!is_dir($directory = app_path('Admin'))) { |
|
| 95 | 95 | mkdir($directory, 0755, true); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -103,13 +103,13 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | protected function createDashboard() |
| 105 | 105 | { |
| 106 | - if (! is_dir($directory = app_path('Admin'))) { |
|
| 106 | + if (!is_dir($directory = app_path('Admin'))) { |
|
| 107 | 107 | mkdir($directory, 0755, true); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | copy(__DIR__.'/stubs/Dashboard.stub', "{$directory}/Dashboard.php"); |
| 111 | 111 | |
| 112 | - if (! is_dir($directory = resource_path('views/admin'))) { |
|
| 112 | + if (!is_dir($directory = resource_path('views/admin'))) { |
|
| 113 | 113 | mkdir($directory, 0755, true); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | $this->publishes([$this->configPath() => config_path('laractive-admin.php')], 'config'); |
| 28 | 28 | |
| 29 | - $this->loadViewsFrom(__DIR__ . '/../resources/views', 'laractive-admin'); |
|
| 29 | + $this->loadViewsFrom(__DIR__.'/../resources/views', 'laractive-admin'); |
|
| 30 | 30 | |
| 31 | 31 | $routeConfig = [ |
| 32 | 32 | 'middleware' => ['web', 'laractive-admin', 'httpauth', 'sharing-data'], |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | ]; |
| 40 | 40 | |
| 41 | 41 | if (is_dir($directory = app_path('Admin'))) { |
| 42 | - $this->getRouter()->group($routeConfig, function ($router) { |
|
| 42 | + $this->getRouter()->group($routeConfig, function($router) { |
|
| 43 | 43 | /** @var $router \Illuminate\Routing\Router */ |
| 44 | 44 | $files = $this->getFilesystem()->allFiles(app_path('Admin')); |
| 45 | 45 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $this->getRouter()->group([ |
| 108 | 108 | 'middleware' => ['web', 'httpauth'], |
| 109 | 109 | 'prefix' => $this->app['config']->get('laractive-admin.route_prefix'), |
| 110 | - ], function ($router) { |
|
| 110 | + ], function($router) { |
|
| 111 | 111 | /** @var $router \Illuminate\Routing\Router */ |
| 112 | 112 | $router->get('login', [ |
| 113 | 113 | 'uses' => '\Enomotodev\LaractiveAdmin\Http\Controllers\Auth\LoginController@showLoginForm', |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | ]); |
| 123 | 123 | }); |
| 124 | 124 | |
| 125 | - \Illuminate\Database\Eloquent\Builder::macro('comments', function () { |
|
| 125 | + \Illuminate\Database\Eloquent\Builder::macro('comments', function() { |
|
| 126 | 126 | return $this->getModel()->morphMany(LaractiveAdminComment::class, 'commentable'); |
| 127 | 127 | }); |
| 128 | 128 | } |
@@ -161,16 +161,16 @@ discard block |
||
| 161 | 161 | $this->getRouter()->aliasMiddleware('httpauth', HttpauthAuthenticate::class); |
| 162 | 162 | $this->getRouter()->aliasMiddleware('sharing-data', SharingDataWithAllViews::class); |
| 163 | 163 | |
| 164 | - $this->app->singleton('command.laractive-admin.install', function ($app) { |
|
| 164 | + $this->app->singleton('command.laractive-admin.install', function($app) { |
|
| 165 | 165 | return new InstallCommand($app['files'], $app['composer']); |
| 166 | 166 | }); |
| 167 | - $this->app->singleton('command.laractive-admin.uninstall', function ($app) { |
|
| 167 | + $this->app->singleton('command.laractive-admin.uninstall', function($app) { |
|
| 168 | 168 | return new UninstallCommand($app['files'], $app['composer']); |
| 169 | 169 | }); |
| 170 | - $this->app->singleton('command.laractive-admin.seed', function () { |
|
| 170 | + $this->app->singleton('command.laractive-admin.seed', function() { |
|
| 171 | 171 | return new SeedCommand; |
| 172 | 172 | }); |
| 173 | - $this->app->singleton('httpauth', function ($app) { |
|
| 173 | + $this->app->singleton('httpauth', function($app) { |
|
| 174 | 174 | return new Httpauth($app['config']->get('laractive-admin.httpauth')); |
| 175 | 175 | }); |
| 176 | 176 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | protected function configPath() |
| 186 | 186 | { |
| 187 | - return __DIR__ . '/../config/laractive-admin.php'; |
|
| 187 | + return __DIR__.'/../config/laractive-admin.php'; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |