@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | * |
| 17 | 17 | * Overwrite file with provided content. |
| 18 | 18 | * |
| 19 | - * @param $file |
|
| 19 | + * @param string $file |
|
| 20 | 20 | * @param $content |
| 21 | 21 | */ |
| 22 | 22 | public function overwrite($file, $content) |
@@ -42,6 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * Get file contents |
| 45 | + * @param string $file |
|
| 45 | 46 | */ |
| 46 | 47 | public function get($file) { |
| 47 | 48 | return file_get_contents($file); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function make($file, $content) |
| 35 | 35 | { |
| 36 | - if ( $this->exists($file)) |
|
| 36 | + if ($this->exists($file)) |
|
| 37 | 37 | { |
| 38 | 38 | throw new FileAlreadyExists; |
| 39 | 39 | } |
@@ -26,22 +26,22 @@ 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]); |
|
| 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 | 36 | } |
| 37 | 37 | |
| 38 | - $this->app->bind('AdminLTE', function () { |
|
| 38 | + $this->app->bind('AdminLTE', function() { |
|
| 39 | 39 | return new \Acacha\AdminLTETemplateLaravel\AdminLTE(); |
| 40 | 40 | }); |
| 41 | 41 | |
| 42 | - if (config('adminlte.gravatar',true)) $this->registerGravatarServiceProvider(); |
|
| 42 | + if (config('adminlte.gravatar', true)) $this->registerGravatarServiceProvider(); |
|
| 43 | 43 | |
| 44 | - if (config('adminlte.guestuser',true)) $this->registerGuestUserProvider(); |
|
| 44 | + if (config('adminlte.guestuser', true)) $this->registerGuestUserProvider(); |
|
| 45 | 45 | |
| 46 | 46 | } |
| 47 | 47 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | if (!$this->app->routesAreCached()) { |
| 92 | 92 | $router = app('router'); |
| 93 | 93 | |
| 94 | - $router->group(['namespace' => $this->getAppNamespace().'Http\Controllers'], function () { |
|
| 94 | + $router->group([ 'namespace' => $this->getAppNamespace().'Http\Controllers' ], function() { |
|
| 95 | 95 | require __DIR__.'/../Http/routes.php'; |
| 96 | 96 | }); |
| 97 | 97 | } |
@@ -39,9 +39,13 @@ |
||
| 39 | 39 | return new \Acacha\AdminLTETemplateLaravel\AdminLTE(); |
| 40 | 40 | }); |
| 41 | 41 | |
| 42 | - if (config('adminlte.gravatar',true)) $this->registerGravatarServiceProvider(); |
|
| 42 | + if (config('adminlte.gravatar',true)) { |
|
| 43 | + $this->registerGravatarServiceProvider(); |
|
| 44 | + } |
|
| 43 | 45 | |
| 44 | - if (config('adminlte.guestuser',true)) $this->registerGuestUserProvider(); |
|
| 46 | + if (config('adminlte.guestuser',true)) { |
|
| 47 | + $this->registerGuestUserProvider(); |
|
| 48 | + } |
|
| 45 | 49 | |
| 46 | 50 | } |
| 47 | 51 | |
@@ -64,14 +64,14 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | try { |
| 66 | 66 | $this->filesystem->overwrite( |
| 67 | - $path = database_path('seeds/' . config('AdminUserSeeder','AdminUserSeeder.php')), |
|
| 67 | + $path = database_path('seeds/'.config('AdminUserSeeder', 'AdminUserSeeder.php')), |
|
| 68 | 68 | $this->compiler->compile( |
| 69 | 69 | $this->filesystem->get($this->getStubPath()), |
| 70 | 70 | [ |
| 71 | 71 | "USER_NAME" => $this->username(), |
| 72 | 72 | "USER_EMAIL" => $this->email(), |
| 73 | 73 | ])); |
| 74 | - $this->info('File ' . $path . ' created'); |
|
| 74 | + $this->info('File '.$path.' created'); |
|
| 75 | 75 | } catch (\Exception $e) { |
| 76 | 76 | print_r($e->getMessage()); |
| 77 | 77 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @return string |
| 84 | 84 | */ |
| 85 | 85 | protected function getStubPath() { |
| 86 | - return __DIR__ . '/stubs/AdminUserSeeder.php.stub'; |
|
| 86 | + return __DIR__.'/stubs/AdminUserSeeder.php.stub'; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | } |
@@ -16,9 +16,13 @@ |
||
| 16 | 16 | * @return mixed|null|string |
| 17 | 17 | */ |
| 18 | 18 | public function username() { |
| 19 | - if (($username = env('ADMIN_USERNAME', null)) != null) return $username; |
|
| 19 | + if (($username = env('ADMIN_USERNAME', null)) != null) { |
|
| 20 | + return $username; |
|
| 21 | + } |
|
| 20 | 22 | |
| 21 | - if (($username = git_user_name()) != null) return $username; |
|
| 23 | + if (($username = git_user_name()) != null) { |
|
| 24 | + return $username; |
|
| 25 | + } |
|
| 22 | 26 | |
| 23 | 27 | return "Admin"; |
| 24 | 28 | } |
@@ -29,11 +29,11 @@ |
||
| 29 | 29 | public function handle() |
| 30 | 30 | { |
| 31 | 31 | $this->call('make:adminUserSeeder'); |
| 32 | - $this->call('db:seed',[ |
|
| 33 | - '--class' => basename(config('AdminUserSeeder','AdminUserSeeder.php'), ".php") |
|
| 32 | + $this->call('db:seed', [ |
|
| 33 | + '--class' => basename(config('AdminUserSeeder', 'AdminUserSeeder.php'), ".php") |
|
| 34 | 34 | ]); |
| 35 | - $this->info('User ' . $this->username() . '(' . $this->email() . ') ' . |
|
| 36 | - $this->passwordInfo() . ' created succesfully!'); |
|
| 35 | + $this->info('User '.$this->username().'('.$this->email().') '. |
|
| 36 | + $this->passwordInfo().' created succesfully!'); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -41,7 +41,9 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | protected function passwordInfo() |
| 43 | 43 | { |
| 44 | - if (env('ADMIN_PWD', '123456') == '123456') return 'with password 123456'; |
|
| 44 | + if (env('ADMIN_PWD', '123456') == '123456') { |
|
| 45 | + return 'with password 123456'; |
|
| 46 | + } |
|
| 45 | 47 | return 'with the environemnt password (env var ADMIN_PWD)'; |
| 46 | 48 | } |
| 47 | 49 | } |
@@ -17,9 +17,13 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | protected function email() |
| 19 | 19 | { |
| 20 | - if (($email = env('ADMIN_EMAIL', null)) != null) return $email; |
|
| 20 | + if (($email = env('ADMIN_EMAIL', null)) != null) { |
|
| 21 | + return $email; |
|
| 22 | + } |
|
| 21 | 23 | |
| 22 | - if (($email = git_user_email()) != null) return $email; |
|
| 24 | + if (($email = git_user_email()) != null) { |
|
| 25 | + return $email; |
|
| 26 | + } |
|
| 23 | 27 | |
| 24 | 28 | return "[email protected]"; |
| 25 | 29 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function compile($template, $data) |
| 20 | 20 | { |
| 21 | - foreach($data as $key => $value) |
|
| 21 | + foreach ($data as $key => $value) |
|
| 22 | 22 | { |
| 23 | 23 | $template = preg_replace("/\\$$key\\$/i", $value, $template); |
| 24 | 24 | } |