@@ -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 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | $controllername = str_replace('/', '\\', $controllername); |
| 22 | 22 | } |
| 23 | 23 | if (str_contains($controllername, '@')) return ucfirst(preg_quote($controllername)); |
| 24 | - return ucfirst(preg_quote($controllername) . '@index'); |
|
| 24 | + return ucfirst(preg_quote($controllername).'@index'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | protected function controllerWithoutMethod($controllername) |
| 34 | 34 | { |
| 35 | - if (str_contains($controller = $controllername, '@')) return ucfirst(substr($controllername, 0, strpos($controllername,'@'))); |
|
| 35 | + if (str_contains($controller = $controllername, '@')) return ucfirst(substr($controllername, 0, strpos($controllername, '@'))); |
|
| 36 | 36 | return ucfirst($controllername); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function controllerMethod($controllername) |
| 46 | 46 | { |
| 47 | - if (str_contains($controller = $controllername, '@')) return substr($controllername, strpos($controllername,'@')+1, strlen($controllername) ); |
|
| 47 | + if (str_contains($controller = $controllername, '@')) return substr($controllername, strpos($controllername, '@') + 1, strlen($controllername)); |
|
| 48 | 48 | return 'index'; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -20,9 +20,9 @@ discard block |
||
| 20 | 20 | * @param StubFileCompiler $compiler |
| 21 | 21 | * @param Filesystem $filesystem |
| 22 | 22 | */ |
| 23 | - public function __construct(StubFileCompiler $compiler,Filesystem $filesystem) |
|
| 23 | + public function __construct(StubFileCompiler $compiler, Filesystem $filesystem) |
|
| 24 | 24 | { |
| 25 | - parent::__construct($compiler,$filesystem); |
|
| 25 | + parent::__construct($compiler, $filesystem); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -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 | |
@@ -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 | } |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | $this->warnIfRouteAlreadyExists($link = $this->argument('link')); |
| 95 | 95 | $tmpfile = $this->createTmpFileWithRoute(); |
| 96 | 96 | $path = $this->getPath($tmpfile); |
| 97 | - add_file_into_file($this->mountpoint(), $path, $dstFile = $this->destinationFile() ); |
|
| 98 | - $this->info('Route ' . $link . ' added to ' . $dstFile . '.'); |
|
| 97 | + add_file_into_file($this->mountpoint(), $path, $dstFile = $this->destinationFile()); |
|
| 98 | + $this->info('Route '.$link.' added to '.$dstFile.'.'); |
|
| 99 | 99 | $this->postActions(); |
| 100 | 100 | } |
| 101 | 101 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $link = $this->removeTrailingSlashIfExists($link); |
| 159 | 159 | $link = $this->removeDuplicatedTrailingSlashes($link); |
| 160 | 160 | foreach (Route::getRoutes() as $value) { |
| 161 | - if (in_array(strtoupper($this->option('method')), array_merge($value->getMethods(), ['ANY'])) && $value->getPath() === $link) { |
|
| 161 | + if (in_array(strtoupper($this->option('method')), array_merge($value->getMethods(), [ 'ANY' ])) && $value->getPath() === $link) { |
|
| 162 | 162 | return true; |
| 163 | 163 | } |
| 164 | 164 | } |
@@ -171,8 +171,8 @@ discard block |
||
| 171 | 171 | * @param $link |
| 172 | 172 | * @return string |
| 173 | 173 | */ |
| 174 | - protected function removeTrailingSlashIfExists($link){ |
|
| 175 | - if (starts_with($link,'/')) return substr($link, 1); |
|
| 174 | + protected function removeTrailingSlashIfExists($link) { |
|
| 175 | + if (starts_with($link, '/')) return substr($link, 1); |
|
| 176 | 176 | return $link; |
| 177 | 177 | } |
| 178 | 178 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | protected function removeDuplicatedTrailingSlashes($link) |
| 186 | 186 | { |
| 187 | - return preg_replace('/(\/+)/','/',$link); |
|
| 187 | + return preg_replace('/(\/+)/', '/', $link); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | protected function apiRouteExists($link) |
| 197 | 197 | { |
| 198 | - return $this->webRouteExists('api/v1/' . $link); |
|
| 198 | + return $this->webRouteExists('api/v1/'.$link); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | protected function getPath($tmpfile) |
| 220 | 220 | { |
| 221 | - return stream_get_meta_data($tmpfile)['uri']; |
|
| 221 | + return stream_get_meta_data($tmpfile)[ 'uri' ]; |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
@@ -229,11 +229,11 @@ discard block |
||
| 229 | 229 | protected function getRouteCode() |
| 230 | 230 | { |
| 231 | 231 | $type = $this->option('type'); |
| 232 | - $class = isset(static::$lookup[$type]) |
|
| 233 | - ? static::$lookup[$type] |
|
| 232 | + $class = isset(static::$lookup[ $type ]) |
|
| 233 | + ? static::$lookup[ $type ] |
|
| 234 | 234 | : RegularRoute::class; |
| 235 | 235 | /** @var GeneratesCode $route */ |
| 236 | - $route = new $class($this->compiler,$this->filesystem); |
|
| 236 | + $route = new $class($this->compiler, $this->filesystem); |
|
| 237 | 237 | $route->setReplacements([ |
| 238 | 238 | $this->argument('link'), |
| 239 | 239 | $this->action(), |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | */ |
| 250 | 250 | protected function method() |
| 251 | 251 | { |
| 252 | - if ( strtolower($this->option('method')) == 'head' ) return 'get'; |
|
| 252 | + if (strtolower($this->option('method')) == 'head') return 'get'; |
|
| 253 | 253 | return strtolower($this->option('method')); |
| 254 | 254 | } |
| 255 | 255 | |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | */ |
| 281 | 281 | protected function validateMethod() |
| 282 | 282 | { |
| 283 | - if (! in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, ['ANY']))) { |
|
| 283 | + if (!in_array(strtoupper($this->option('method')), $methods = array_merge(Router::$verbs, [ 'ANY' ]))) { |
|
| 284 | 284 | throw new MethodNotAllowedException($methods); |
| 285 | 285 | } |
| 286 | 286 | } |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | */ |
| 291 | 291 | protected function validateType() |
| 292 | 292 | { |
| 293 | - if (! in_array( strtolower($this->option('type')),['regular','controller','resource'])) { |
|
| 293 | + if (!in_array(strtolower($this->option('type')), [ 'regular', 'controller', 'resource' ])) { |
|
| 294 | 294 | throw new RouteTypeNotValid(); |
| 295 | 295 | } |
| 296 | 296 | } |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | Artisan::call('make:view', [ |
| 323 | 323 | 'name' => $this->action() |
| 324 | 324 | ]); |
| 325 | - $this->info('View ' . $this->action() .'.blade.php created.'); |
|
| 325 | + $this->info('View '.$this->action().'.blade.php created.'); |
|
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | /** |
@@ -333,8 +333,8 @@ discard block |
||
| 333 | 333 | Artisan::call('make:controller', [ |
| 334 | 334 | 'name' => $controller = $this->controllerWithoutMethod($this->action()) |
| 335 | 335 | ]); |
| 336 | - $this->addMethodToController($controller,$this->controllerMethod($this->action())); |
|
| 337 | - $this->info('Controller ' . $controller .' created.'); |
|
| 336 | + $this->addMethodToController($controller, $this->controllerMethod($this->action())); |
|
| 337 | + $this->info('Controller '.$controller.' created.'); |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /** |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | 'name' => $controller = $this->controllerWithoutMethod($this->action()), |
| 347 | 347 | '--resource' => true |
| 348 | 348 | ]); |
| 349 | - $this->info('Resource Controller ' . $controller .' created.'); |
|
| 349 | + $this->info('Resource Controller '.$controller.' created.'); |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | /** |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | { |
| 360 | 360 | $tmpfile = $this->createTmpFileWithMethod($controllerMethod); |
| 361 | 361 | $path = $this->getPath($tmpfile); |
| 362 | - add_file_into_file('\/\/',$path,app_path('Http/Controllers/' . $controller . '.php')); |
|
| 362 | + add_file_into_file('\/\/', $path, app_path('Http/Controllers/'.$controller.'.php')); |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | /** |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | */ |
| 399 | 399 | protected function getMethodStubPath() |
| 400 | 400 | { |
| 401 | - return __DIR__ . '/stubs/method.stub'; |
|
| 401 | + return __DIR__.'/stubs/method.stub'; |
|
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | } |
@@ -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. |