@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | ]; |
36 | 36 | |
37 | 37 | if (is_dir($directory = app_path('Admin'))) { |
38 | - $this->getRouter()->group($routeConfig, function ($router) { |
|
38 | + $this->getRouter()->group($routeConfig, function($router) { |
|
39 | 39 | /** @var $router \Illuminate\Routing\Router */ |
40 | 40 | $files = $this->getFilesystem()->allFiles(app_path('Admin')); |
41 | 41 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | ]); |
117 | 117 | }); |
118 | 118 | |
119 | - \Illuminate\Database\Eloquent\Builder::macro('comments', function () { |
|
119 | + \Illuminate\Database\Eloquent\Builder::macro('comments', function() { |
|
120 | 120 | return $this->getModel()->morphMany(LaractiveAdminComment::class, 'commentable'); |
121 | 121 | }); |
122 | 122 | } |
@@ -152,13 +152,13 @@ discard block |
||
152 | 152 | |
153 | 153 | $this->getRouter()->aliasMiddleware('laractive-admin', LaractiveAdminAuthenticate::class); |
154 | 154 | |
155 | - $this->app->singleton('command.laractive-admin.install', function ($app) { |
|
155 | + $this->app->singleton('command.laractive-admin.install', function($app) { |
|
156 | 156 | return new InstallCommand($app['files'], $app['composer']); |
157 | 157 | }); |
158 | - $this->app->singleton('command.laractive-admin.uninstall', function ($app) { |
|
158 | + $this->app->singleton('command.laractive-admin.uninstall', function($app) { |
|
159 | 159 | return new UninstallCommand($app['files'], $app['composer']); |
160 | 160 | }); |
161 | - $this->app->singleton('command.laractive-admin.seed', function () { |
|
161 | + $this->app->singleton('command.laractive-admin.seed', function() { |
|
162 | 162 | return new SeedCommand; |
163 | 163 | }); |
164 | 164 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | protected function configPath() |
174 | 174 | { |
175 | - return __DIR__ . '/../config/laractive-admin.php'; |
|
175 | + return __DIR__.'/../config/laractive-admin.php'; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | public function show(int $id) |
97 | 97 | { |
98 | 98 | $model = $this->model::findOrFail($id); |
99 | - $commentColumns = array_filter($this->getColumnsFromTable($model->comments()->getRelated()), function ($type, $name) use ($model) { |
|
99 | + $commentColumns = array_filter($this->getColumnsFromTable($model->comments()->getRelated()), function($type, $name) use ($model) { |
|
100 | 100 | return !in_array($name, ['id', 'updated_at', $model->comments()->getForeignKeyName(), $model->comments()->getMorphType()]); |
101 | 101 | }, ARRAY_FILTER_USE_BOTH); |
102 | 102 | |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function create(Request $request) |
141 | 141 | { |
142 | - $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function ($item) { |
|
142 | + $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function($item) { |
|
143 | 143 | return $item !== null; |
144 | 144 | }); |
145 | 145 | if (isset($inputs['password'])) { |
146 | 146 | $inputs['password'] = \Hash::make($inputs['password']); |
147 | 147 | } |
148 | 148 | if ($this->files) { |
149 | - $files = array_filter($inputs, function ($item, $key) { |
|
149 | + $files = array_filter($inputs, function($item, $key) { |
|
150 | 150 | return in_array($key, $this->files) && $item instanceof UploadedFile; |
151 | 151 | }, ARRAY_FILTER_USE_BOTH); |
152 | 152 | |
@@ -204,14 +204,14 @@ discard block |
||
204 | 204 | public function update(Request $request, int $id) |
205 | 205 | { |
206 | 206 | $model = $this->model::findOrFail($id); |
207 | - $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function ($item) { |
|
207 | + $inputs = $this->validate ? $request->validate($this->validate) : array_filter($request->post(), function($item) { |
|
208 | 208 | return $item !== null; |
209 | 209 | }); |
210 | 210 | if (isset($inputs['password'])) { |
211 | 211 | $inputs['password'] = \Hash::make($inputs['password']); |
212 | 212 | } |
213 | 213 | if ($this->files) { |
214 | - $files = array_filter($inputs, function ($item, $key) { |
|
214 | + $files = array_filter($inputs, function($item, $key) { |
|
215 | 215 | return in_array($key, $this->files) && $item instanceof UploadedFile; |
216 | 216 | }, ARRAY_FILTER_USE_BOTH); |
217 | 217 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | |
293 | 293 | try { |
294 | 294 | $methods = (new ReflectionClass($model))->getMethods(ReflectionMethod::IS_PUBLIC); |
295 | - foreach($methods as $method) { |
|
295 | + foreach ($methods as $method) { |
|
296 | 296 | if ( |
297 | 297 | $method->class != get_class($model) || |
298 | 298 | !empty($method->getParameters()) || |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | try { |
67 | 67 | foreach ($migrations as $migration) { |
68 | 68 | $fullPath = $this->createBaseMigration($migration); |
69 | - $this->files->put($fullPath, $this->files->get(__DIR__ . "/stubs/{$migration}.stub")); |
|
69 | + $this->files->put($fullPath, $this->files->get(__DIR__."/stubs/{$migration}.stub")); |
|
70 | 70 | } |
71 | 71 | $this->composer->dumpAutoloads(); |
72 | 72 | } catch (FileNotFoundException $exception) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function createAdminUser() |
92 | 92 | { |
93 | - if (! is_dir($directory = app_path('Admin'))) { |
|
93 | + if (!is_dir($directory = app_path('Admin'))) { |
|
94 | 94 | mkdir($directory, 0755, true); |
95 | 95 | } |
96 | 96 |