@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::table('users', function (Blueprint $table) { |
|
| 16 | + Schema::table('users', function(Blueprint $table) { |
|
| 17 | 17 | $table->string('username')->unique()->nullable()->after('name'); |
| 18 | 18 | }); |
| 19 | 19 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function down() |
| 27 | 27 | { |
| 28 | - Schema::table('users', function (Blueprint $table) { |
|
| 28 | + Schema::table('users', function(Blueprint $table) { |
|
| 29 | 29 | $table->dropColumn('username'); |
| 30 | 30 | }); |
| 31 | 31 | } |
@@ -26,25 +26,25 @@ 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\MakeRoute::class]); |
|
| 40 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\MakeMenu::class]); |
|
| 41 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\MakeV::class]); |
|
| 42 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\MakeVC::class]); |
|
| 43 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\MakeMVC::class]); |
|
| 44 | - $this->commands([\Acacha\AdminLTETemplateLaravel\Console\Username::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\MakeRoute::class ]); |
|
| 40 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\MakeMenu::class ]); |
|
| 41 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\MakeV::class ]); |
|
| 42 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\MakeVC::class ]); |
|
| 43 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\MakeMVC::class ]); |
|
| 44 | + $this->commands([ \Acacha\AdminLTETemplateLaravel\Console\Username::class ]); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - $this->app->bind('AdminLTE', function () { |
|
| 47 | + $this->app->bind('AdminLTE', function() { |
|
| 48 | 48 | return new \Acacha\AdminLTETemplateLaravel\AdminLTE(); |
| 49 | 49 | }); |
| 50 | 50 | |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | if (config('adminlte.guestuser', true)) { |
| 56 | 56 | $this->registerGuestUserProvider(); |
| 57 | 57 | } |
| 58 | - if (config('auth.providers.users.field', 'email') === 'username' && config('adminlte.add_nullable_username', true)) { |
|
| 59 | - $this->loadMigrationsFrom(ADMINLTETEMPLATE_PATH .'/database/migrations/username_login'); |
|
| 58 | + if (config('auth.providers.users.field', 'email') === 'username' && config('adminlte.add_nullable_username', true)) { |
|
| 59 | + $this->loadMigrationsFrom(ADMINLTETEMPLATE_PATH.'/database/migrations/username_login'); |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | if (!$this->app->routesAreCached()) { |
| 117 | 117 | $router = app('router'); |
| 118 | 118 | |
| 119 | - $router->group(['namespace' => $this->getAppNamespace().'Http\Controllers'], function () { |
|
| 119 | + $router->group([ 'namespace' => $this->getAppNamespace().'Http\Controllers' ], function() { |
|
| 120 | 120 | require __DIR__.'/../Http/routes.php'; |
| 121 | 121 | }); |
| 122 | 122 | } |
@@ -64,7 +64,7 @@ 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 | [ |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | ] |
| 74 | 74 | ) |
| 75 | 75 | ); |
| 76 | - $this->info('File ' . $path . ' created'); |
|
| 76 | + $this->info('File '.$path.' created'); |
|
| 77 | 77 | } catch (\Exception $e) { |
| 78 | 78 | print_r($e->getMessage()); |
| 79 | 79 | } |
@@ -86,6 +86,6 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | protected function getStubPath() |
| 88 | 88 | { |
| 89 | - return __DIR__ . '/stubs/AdminUserSeeder.php'; |
|
| 89 | + return __DIR__.'/stubs/AdminUserSeeder.php'; |
|
| 90 | 90 | } |
| 91 | 91 | } |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | try { |
| 55 | 55 | $this->filesystem->make( |
| 56 | - $path = resource_path('views/' . $this->viewPath()), |
|
| 56 | + $path = resource_path('views/'.$this->viewPath()), |
|
| 57 | 57 | $this->filesystem->get($this->getStubPath()), |
| 58 | 58 | true |
| 59 | 59 | ); |
| 60 | - $this->info('File ' . $path . ' created'); |
|
| 60 | + $this->info('File '.$path.' created'); |
|
| 61 | 61 | } catch (\Exception $e) { |
| 62 | 62 | $this->error($e->getMessage()); |
| 63 | 63 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | protected function getStubPath() |
| 70 | 70 | { |
| 71 | - return __DIR__ . '/stubs/view.blade.php'; |
|
| 71 | + return __DIR__.'/stubs/view.blade.php'; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | protected function constructViewBladeName($name) |
| 91 | 91 | { |
| 92 | - return $this->dottedPathToSlashesPath($name) . '.blade.php'; |
|
| 92 | + return $this->dottedPathToSlashesPath($name).'.blade.php'; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | factory(App\User::class)->create([ |
| 19 | 19 | "name" => env('ADMIN_USER', "$USER_NAME$"), |
| 20 | 20 | "email" => env('ADMIN_EMAIL', "$USER_EMAIL"), |
| 21 | - "password" => bcrypt(env('ADMIN_PWD', '123456'))] |
|
| 21 | + "password" => bcrypt(env('ADMIN_PWD', '123456')) ] |
|
| 22 | 22 | ); |
| 23 | 23 | } catch (\Illuminate\Database\QueryException $exception) { |
| 24 | 24 | } |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | public function handle() |
| 30 | 30 | { |
| 31 | 31 | $this->create_admin_user(); |
| 32 | - $this->info('User ' . $this->username() . '(' . $this->email() . ') ' . |
|
| 33 | - $this->passwordInfo() . ' created succesfully!'); |
|
| 32 | + $this->info('User '.$this->username().'('.$this->email().') '. |
|
| 33 | + $this->passwordInfo().' created succesfully!'); |
|
| 34 | 34 | $this->call('make:adminUserSeeder'); |
| 35 | 35 | $this->info('A database seed has been created to permanently add admin user to database.'); |
| 36 | 36 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | factory(get_class(app('App\User')))->create([ |
| 45 | 45 | "name" => env('ADMIN_USER', $this->username()), |
| 46 | 46 | "email" => env('ADMIN_EMAIL', $this->email()), |
| 47 | - "password" => bcrypt(env('ADMIN_PWD', '123456'))] |
|
| 47 | + "password" => bcrypt(env('ADMIN_PWD', '123456')) ] |
|
| 48 | 48 | ); |
| 49 | 49 | } catch (\Illuminate\Database\QueryException $exception) { |
| 50 | 50 | } |
@@ -79,12 +79,12 @@ |
||
| 79 | 79 | protected function create(array $data) |
| 80 | 80 | { |
| 81 | 81 | $fields = [ |
| 82 | - 'name' => $data['name'], |
|
| 83 | - 'email' => $data['email'], |
|
| 84 | - 'password' => bcrypt($data['password']), |
|
| 82 | + 'name' => $data[ 'name' ], |
|
| 83 | + 'email' => $data[ 'email' ], |
|
| 84 | + 'password' => bcrypt($data[ 'password' ]), |
|
| 85 | 85 | ]; |
| 86 | - if (config('auth.providers.users.field','email') === 'username' && isset($data['username'])) { |
|
| 87 | - $fields['username'] = $data['username']; |
|
| 86 | + if (config('auth.providers.users.field', 'email') === 'username' && isset($data[ 'username' ])) { |
|
| 87 | + $fields[ 'username' ] = $data[ 'username' ]; |
|
| 88 | 88 | } |
| 89 | 89 | return User::create($fields); |
| 90 | 90 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function __construct() |
| 49 | 49 | { |
| 50 | - $this->middleware('guest', ['except' => 'logout']); |
|
| 50 | + $this->middleware('guest', [ 'except' => 'logout' ]); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function username() |
| 59 | 59 | { |
| 60 | - return config('auth.providers.users.field','email'); |
|
| 60 | + return config('auth.providers.users.field', 'email'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | protected function attemptLogin(Request $request) |
| 70 | 70 | { |
| 71 | 71 | if ($this->username() === 'email') return $this->attemptLoginAtAuthenticatesUsers($request); |
| 72 | - if ( ! $this->attemptLoginAtAuthenticatesUsers($request)) { |
|
| 72 | + if (!$this->attemptLoginAtAuthenticatesUsers($request)) { |
|
| 73 | 73 | return $this->attempLoginUsingUsernameAsAnEmail($request); |
| 74 | 74 | } |
| 75 | 75 | return false; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | protected function attempLoginUsingUsernameAsAnEmail(Request $request) |
| 85 | 85 | { |
| 86 | 86 | return $this->guard()->attempt( |
| 87 | - ['email' => $request->input('username'), 'password' => $request->input('password')], |
|
| 87 | + [ 'email' => $request->input('username'), 'password' => $request->input('password') ], |
|
| 88 | 88 | $request->has('remember')); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | // will update the password on an actual user model and persist it to the |
| 38 | 38 | // database. Otherwise we will parse the error and return the response. |
| 39 | 39 | $response = $this->broker()->reset( |
| 40 | - $this->credentials($request), function ($user, $password) { |
|
| 40 | + $this->credentials($request), function($user, $password) { |
|
| 41 | 41 | $this->resetPassword($user, $password); |
| 42 | 42 | } |
| 43 | 43 | ); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @param string $response |
| 58 | 58 | * @return \Illuminate\Http\RedirectResponse |
| 59 | 59 | */ |
| 60 | - protected function sendResetResponse(Request $request,$response) |
|
| 60 | + protected function sendResetResponse(Request $request, $response) |
|
| 61 | 61 | { |
| 62 | 62 | if ($request->expectsJson()) { |
| 63 | 63 | return response()->json([ |
@@ -78,11 +78,11 @@ discard block |
||
| 78 | 78 | protected function sendResetFailedResponse(Request $request, $response) |
| 79 | 79 | { |
| 80 | 80 | if ($request->expectsJson()) { |
| 81 | - return new JsonResponse(['email' => trans($response) ], 422); |
|
| 81 | + return new JsonResponse([ 'email' => trans($response) ], 422); |
|
| 82 | 82 | } |
| 83 | 83 | return redirect()->back() |
| 84 | 84 | ->withInput($request->only('email')) |
| 85 | - ->withErrors(['email' => trans($response)]); |
|
| 85 | + ->withErrors([ 'email' => trans($response) ]); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | public function showResetForm(Request $request, $token = null) |
| 98 | 98 | { |
| 99 | 99 | return view('adminlte::auth.passwords.reset')->with( |
| 100 | - ['token' => $token, 'email' => $request->email] |
|
| 100 | + [ 'token' => $token, 'email' => $request->email ] |
|
| 101 | 101 | ); |
| 102 | 102 | } |
| 103 | 103 | |