@@ -26,21 +26,21 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | if ($this->app->runningInConsole()) { |
| 29 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTE::class]); |
|
| 30 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTEAlt::class]); |
|
| 31 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTESidebar::class]); |
|
| 32 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTESidebarAlt::class]); |
|
| 33 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\MakeAdminUserSeeder::class]); |
|
| 34 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\AdminLTEAdmin::class]); |
|
| 35 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\AdminLTEAdminAlt::class]); |
|
| 36 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\MakeView::class]); |
|
| 37 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\AdminLTEMenu::class]); |
|
| 38 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\AdminLTEMenuAlt::class]); |
|
| 39 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\AdminLTERoute::class]); |
|
| 40 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\AdminLTERouteAlt::class]); |
|
| 29 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTE::class ]); |
|
| 30 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTEAlt::class ]); |
|
| 31 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTESidebar::class ]); |
|
| 32 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\PublishAdminLTESidebarAlt::class ]); |
|
| 33 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\MakeAdminUserSeeder::class ]); |
|
| 34 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\AdminLTEAdmin::class ]); |
|
| 35 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\AdminLTEAdminAlt::class ]); |
|
| 36 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\MakeView::class ]); |
|
| 37 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\AdminLTEMenu::class ]); |
|
| 38 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\AdminLTEMenuAlt::class ]); |
|
| 39 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\AdminLTERoute::class ]); |
|
| 40 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\AdminLTERouteAlt::class ]); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - $this->app->bind('AdminLTE', function () { |
|
| 43 | + $this->app->bind('AdminLTE', function() { |
|
| 44 | 44 | return new \Acacha\AdminLTETemplateLaravel\AdminLTE(); |
| 45 | 45 | }); |
| 46 | 46 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | if (!$this->app->routesAreCached()) { |
| 104 | 104 | $router = app('router'); |
| 105 | 105 | |
| 106 | - $router->group(['namespace' => $this->getAppNamespace().'Http\Controllers'], function () { |
|
| 106 | + $router->group([ 'namespace' => $this->getAppNamespace().'Http\Controllers' ], function() { |
|
| 107 | 107 | require __DIR__.'/../Http/routes.php'; |
| 108 | 108 | }); |
| 109 | 109 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | protected function getStubPath() |
| 33 | 33 | { |
| 34 | - return __DIR__ . '/../stubs/route.stub'; |
|
| 34 | + return __DIR__.'/../stubs/route.stub'; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -40,9 +40,9 @@ discard block |
||
| 40 | 40 | protected function obtainReplacements() |
| 41 | 41 | { |
| 42 | 42 | return [ |
| 43 | - 'ROUTE_LINK' => $this->getReplacements()[0], |
|
| 44 | - 'ROUTE_VIEW' => $this->getReplacements()[1], |
|
| 45 | - 'ROUTE_METHOD' => $this->getReplacements()[2], |
|
| 43 | + 'ROUTE_LINK' => $this->getReplacements()[ 0 ], |
|
| 44 | + 'ROUTE_VIEW' => $this->getReplacements()[ 1 ], |
|
| 45 | + 'ROUTE_METHOD' => $this->getReplacements()[ 2 ], |
|
| 46 | 46 | ]; |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | protected function getStubPath() |
| 34 | 34 | { |
| 35 | - return __DIR__ . '/../stubs/route_with_resource_controller.stub'; |
|
| 35 | + return __DIR__.'/../stubs/route_with_resource_controller.stub'; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | protected function obtainReplacements() |
| 44 | 44 | { |
| 45 | 45 | return [ |
| 46 | - 'ROUTE_LINK' => $this->getReplacements()[0], |
|
| 47 | - 'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[1]), |
|
| 46 | + 'ROUTE_LINK' => $this->getReplacements()[ 0 ], |
|
| 47 | + 'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[ 1 ]), |
|
| 48 | 48 | ]; |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -11,11 +11,11 @@ |
||
| 11 | 11 | | |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | -Route::get('/', function () { |
|
| 14 | +Route::get('/', function() { |
|
| 15 | 15 | return view('welcome'); |
| 16 | 16 | }); |
| 17 | 17 | |
| 18 | -Route::group(['middleware' => 'auth'], function () { |
|
| 18 | +Route::group([ 'middleware' => 'auth' ], function() { |
|
| 19 | 19 | // Route::get('/link1', function () { |
| 20 | 20 | // // Uses Auth Middleware |
| 21 | 21 | // }); |
@@ -13,11 +13,11 @@ |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -Route::get('/user', function (Request $request) { |
|
| 16 | +Route::get('/user', function(Request $request) { |
|
| 17 | 17 | return $request->user(); |
| 18 | 18 | })->middleware('auth:api'); |
| 19 | 19 | |
| 20 | -Route::group(['prefix' => 'v1','middleware' => 'auth:api'], function () { |
|
| 20 | +Route::group([ 'prefix' => 'v1', 'middleware' => 'auth:api' ], function() { |
|
| 21 | 21 | // Route::resource('task', 'TasksController'); |
| 22 | 22 | |
| 23 | 23 | //Please do not remove this if you want adminlte:route and adminlte:link commands to works correctly. |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | protected function getStubPath() |
| 34 | 34 | { |
| 35 | - return __DIR__ . '/../stubs/route_with_controller.stub'; |
|
| 35 | + return __DIR__.'/../stubs/route_with_controller.stub'; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | protected function obtainReplacements() |
| 44 | 44 | { |
| 45 | 45 | return [ |
| 46 | - 'ROUTE_LINK' => $this->getReplacements()[0], |
|
| 47 | - 'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[1]), |
|
| 48 | - 'ROUTE_METHOD' => $this->getReplacements()[2], |
|
| 46 | + 'ROUTE_LINK' => $this->getReplacements()[ 0 ], |
|
| 47 | + 'ROUTE_CONTROLLER' => $this->controller($this->getReplacements()[ 1 ]), |
|
| 48 | + 'ROUTE_METHOD' => $this->getReplacements()[ 2 ], |
|
| 49 | 49 | ]; |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | if (str_contains($controllername, '@')) { |
| 25 | 25 | return ucfirst($controllername); |
| 26 | 26 | } |
| 27 | - return ucfirst($controllername . '@index'); |
|
| 27 | + return ucfirst($controllername.'@index'); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | protected function controllerMethod($controllername) |
| 51 | 51 | { |
| 52 | 52 | if (str_contains($controller = $controllername, '@')) { |
| 53 | - return substr($controllername, strpos($controllername, '@')+1, strlen($controllername)); |
|
| 53 | + return substr($controllername, strpos($controllername, '@') + 1, strlen($controllername)); |
|
| 54 | 54 | } |
| 55 | 55 | return 'index'; |
| 56 | 56 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | * Check if route exists. |
| 147 | 147 | * |
| 148 | 148 | * @param $link |
| 149 | - * @return mixed |
|
| 149 | + * @return boolean |
|
| 150 | 150 | */ |
| 151 | 151 | protected function routeExists($link) |
| 152 | 152 | { |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * Check if web route exists. |
| 161 | 161 | * |
| 162 | 162 | * @param $link |
| 163 | - * @return mixed |
|
| 163 | + * @return boolean |
|
| 164 | 164 | */ |
| 165 | 165 | protected function webRouteExists($link) |
| 166 | 166 | { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | /** |
| 193 | 193 | * Remove duplicated trailing slashes. |
| 194 | 194 | * |
| 195 | - * @param $link |
|
| 195 | + * @param string $link |
|
| 196 | 196 | * @return mixed |
| 197 | 197 | */ |
| 198 | 198 | protected function removeDuplicatedTrailingSlashes($link) |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * Check if api route exists. |
| 205 | 205 | * |
| 206 | 206 | * @param $link |
| 207 | - * @return mixed |
|
| 207 | + * @return boolean |
|
| 208 | 208 | */ |
| 209 | 209 | protected function apiRouteExists($link) |
| 210 | 210 | { |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | /** |
| 215 | 215 | * Crete tmp file with route to add. |
| 216 | 216 | * |
| 217 | - * @return mixed |
|
| 217 | + * @return resource |
|
| 218 | 218 | */ |
| 219 | 219 | protected function createTmpFileWithRoute() |
| 220 | 220 | { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | /** |
| 227 | 227 | * Get path from file resource. |
| 228 | 228 | * |
| 229 | - * @param $tmpfile |
|
| 229 | + * @param resource $tmpfile |
|
| 230 | 230 | * @return mixed |
| 231 | 231 | */ |
| 232 | 232 | protected function getPath($tmpfile) |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | /** |
| 238 | 238 | * Get route code to insert depending on type. |
| 239 | 239 | * |
| 240 | - * @return mixed |
|
| 240 | + * @return string |
|
| 241 | 241 | */ |
| 242 | 242 | protected function getRouteCode() |
| 243 | 243 | { |
@@ -378,8 +378,8 @@ discard block |
||
| 378 | 378 | /** |
| 379 | 379 | * Add method to controller. |
| 380 | 380 | * |
| 381 | - * @param $controller |
|
| 382 | - * @param $controllerMethod * |
|
| 381 | + * @param string $controller |
|
| 382 | + * @param string $controllerMethod * |
|
| 383 | 383 | */ |
| 384 | 384 | protected function addMethodToController($controller, $controllerMethod) |
| 385 | 385 | { |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | * Crete tmp file with route to add. |
| 393 | 393 | * |
| 394 | 394 | * @param $controllerMethod |
| 395 | - * @return mixed |
|
| 395 | + * @return resource |
|
| 396 | 396 | */ |
| 397 | 397 | protected function createTmpFileWithMethod($controllerMethod) |
| 398 | 398 | { |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | * Get method code. |
| 406 | 406 | * |
| 407 | 407 | * @param $controllerMethod |
| 408 | - * @return mixed |
|
| 408 | + * @return string |
|
| 409 | 409 | */ |
| 410 | 410 | protected function getMethodCode($controllerMethod) |
| 411 | 411 | { |
@@ -278,7 +278,9 @@ discard block |
||
| 278 | 278 | if ($this->argument('action') != null) { |
| 279 | 279 | return $this->argument('action'); |
| 280 | 280 | } |
| 281 | - if (strtolower($this->option('type')) != 'regular' ) return $this->argument('link') . 'Controller'; |
|
| 281 | + if (strtolower($this->option('type')) != 'regular' ) { |
|
| 282 | + return $this->argument('link') . 'Controller'; |
|
| 283 | + } |
|
| 282 | 284 | return $this->argument('link'); |
| 283 | 285 | } |
| 284 | 286 | |
@@ -342,7 +344,9 @@ discard block |
||
| 342 | 344 | */ |
| 343 | 345 | protected function createView($name = null) |
| 344 | 346 | { |
| 345 | - if ($name == null) $name = $this->action(); |
|
| 347 | + if ($name == null) { |
|
| 348 | + $name = $this->action(); |
|
| 349 | + } |
|
| 346 | 350 | Artisan::call('make:view', [ |
| 347 | 351 | 'name' => $name |
| 348 | 352 | ]); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $tmpfile = $this->createTmpFileWithRoute(); |
| 98 | 98 | $path = $this->getPath($tmpfile); |
| 99 | 99 | add_file_into_file($this->mountpoint(), $path, $dstFile = $this->destinationFile()); |
| 100 | - $this->info('Route ' . $link . ' added to ' . $dstFile . '.'); |
|
| 100 | + $this->info('Route '.$link.' added to '.$dstFile.'.'); |
|
| 101 | 101 | $this->postActions(); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $link = $this->removeTrailingSlashIfExists($link); |
| 168 | 168 | $link = $this->removeDuplicatedTrailingSlashes($link); |
| 169 | 169 | foreach (Route::getRoutes() as $value) { |
| 170 | - if (in_array(strtoupper($this->option('method')), array_merge($value->getMethods(), ['ANY'])) && |
|
| 170 | + if (in_array(strtoupper($this->option('method')), array_merge($value->getMethods(), [ 'ANY' ])) && |
|
| 171 | 171 | $value->getPath() === $link) { |
| 172 | 172 | return true; |
| 173 | 173 | } |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | protected function apiRouteExists($link) |
| 210 | 210 | { |
| 211 | - return $this->webRouteExists('api/v1/' . $link); |
|
| 211 | + return $this->webRouteExists('api/v1/'.$link); |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /** |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | protected function getPath($tmpfile) |
| 233 | 233 | { |
| 234 | - return stream_get_meta_data($tmpfile)['uri']; |
|
| 234 | + return stream_get_meta_data($tmpfile)[ 'uri' ]; |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /** |
@@ -242,8 +242,8 @@ discard block |
||
| 242 | 242 | protected function getRouteCode() |
| 243 | 243 | { |
| 244 | 244 | $type = $this->option('type'); |
| 245 | - $class = isset(static::$lookup[$type]) |
|
| 246 | - ? static::$lookup[$type] |
|
| 245 | + $class = isset(static::$lookup[ $type ]) |
|
| 246 | + ? static::$lookup[ $type ] |
|
| 247 | 247 | : RegularRoute::class; |
| 248 | 248 | /** @var GeneratesCode $route */ |
| 249 | 249 | $route = new $class($this->compiler, $this->filesystem); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | if ($this->argument('action') != null) { |
| 279 | 279 | return $this->argument('action'); |
| 280 | 280 | } |
| 281 | - if (strtolower($this->option('type')) != 'regular' ) return $this->argument('link') . 'Controller'; |
|
| 281 | + if (strtolower($this->option('type')) != 'regular') return $this->argument('link').'Controller'; |
|
| 282 | 282 | return $this->argument('link'); |
| 283 | 283 | } |
| 284 | 284 | |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | */ |
| 297 | 297 | protected function validateMethod() |
| 298 | 298 | { |
| 299 | - if (! in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, ['ANY']))) { |
|
| 299 | + if (!in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, [ 'ANY' ]))) { |
|
| 300 | 300 | throw new MethodNotAllowedException($methods); |
| 301 | 301 | } |
| 302 | 302 | } |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | */ |
| 307 | 307 | protected function validateType() |
| 308 | 308 | { |
| 309 | - if (! in_array(strtolower($this->option('type')), ['regular','controller','resource'])) { |
|
| 309 | + if (!in_array(strtolower($this->option('type')), [ 'regular', 'controller', 'resource' ])) { |
|
| 310 | 310 | throw new RouteTypeNotValid(); |
| 311 | 311 | } |
| 312 | 312 | } |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | Artisan::call('make:view', [ |
| 347 | 347 | 'name' => $name |
| 348 | 348 | ]); |
| 349 | - $this->info('View ' . $name .'.blade.php created.'); |
|
| 349 | + $this->info('View '.$name.'.blade.php created.'); |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | /** |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | 'name' => $controller = $this->controllerWithoutMethod($this->action()) |
| 359 | 359 | ]); |
| 360 | 360 | $this->addMethodToController($controller, $this->controllerMethod($this->action())); |
| 361 | - $this->info('Controller ' . $controller .' created.'); |
|
| 361 | + $this->info('Controller '.$controller.' created.'); |
|
| 362 | 362 | $this->createView($this->argument('link')); |
| 363 | 363 | } |
| 364 | 364 | |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | 'name' => $controller = $this->controllerWithoutMethod($this->action()), |
| 372 | 372 | '--resource' => true |
| 373 | 373 | ]); |
| 374 | - $this->info('Resource Controller ' . $controller .' created.'); |
|
| 374 | + $this->info('Resource Controller '.$controller.' created.'); |
|
| 375 | 375 | $this->createView($this->argument('link')); |
| 376 | 376 | } |
| 377 | 377 | |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | { |
| 386 | 386 | $tmpfile = $this->createTmpFileWithMethod($controllerMethod); |
| 387 | 387 | $path = $this->getPath($tmpfile); |
| 388 | - add_file_into_file('\/\/', $path, app_path('Http/Controllers/' . $controller . '.php')); |
|
| 388 | + add_file_into_file('\/\/', $path, app_path('Http/Controllers/'.$controller.'.php')); |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | /** |
@@ -425,6 +425,6 @@ discard block |
||
| 425 | 425 | */ |
| 426 | 426 | protected function getMethodStubPath() |
| 427 | 427 | { |
| 428 | - return __DIR__ . '/stubs/method.stub'; |
|
| 428 | + return __DIR__.'/stubs/method.stub'; |
|
| 429 | 429 | } |
| 430 | 430 | } |