@@ -2,10 +2,10 @@ |
||
2 | 2 | |
3 | 3 | namespace App\Http\Controllers\Auth; |
4 | 4 | |
5 | -use App\User; |
|
6 | -use Validator; |
|
7 | 5 | use App\Http\Controllers\Controller; |
6 | +use App\User; |
|
8 | 7 | use Illuminate\Foundation\Auth\RegistersUsers; |
8 | +use Validator; |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Class RegisterController |
@@ -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 | } |
@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | use App\Http\Controllers\Controller; |
6 | 6 | use Illuminate\Foundation\Auth\ResetsPasswords; |
7 | +use Illuminate\Http\JsonResponse; |
|
7 | 8 | use Illuminate\Http\Request; |
8 | 9 | use Illuminate\Support\Facades\Password; |
9 | -use Illuminate\Http\JsonResponse; |
|
10 | 10 | |
11 | 11 | class ResetPasswordController extends Controller |
12 | 12 | { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | // database. Otherwise we will parse the error and return the response. |
39 | 39 | $response = $this->broker()->reset( |
40 | 40 | $this->credentials($request), |
41 | - function ($user, $password) { |
|
41 | + function($user, $password) { |
|
42 | 42 | $this->resetPassword($user, $password); |
43 | 43 | } |
44 | 44 | ); |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | protected function sendResetFailedResponse(Request $request, $response) |
80 | 80 | { |
81 | 81 | if ($request->expectsJson()) { |
82 | - return new JsonResponse(['email' => trans($response) ], 422); |
|
82 | + return new JsonResponse([ 'email' => trans($response) ], 422); |
|
83 | 83 | } |
84 | 84 | return redirect()->back() |
85 | 85 | ->withInput($request->only('email')) |
86 | - ->withErrors(['email' => trans($response)]); |
|
86 | + ->withErrors([ 'email' => trans($response) ]); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | public function showResetForm(Request $request, $token = null) |
99 | 99 | { |
100 | 100 | return view('adminlte::auth.passwords.reset')->with( |
101 | - ['token' => $token, 'email' => $request->email] |
|
101 | + [ 'token' => $token, 'email' => $request->email ] |
|
102 | 102 | ); |
103 | 103 | } |
104 | 104 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * @var array |
16 | 16 | */ |
17 | 17 | protected $fillable = [ |
18 | - 'name', 'email', 'password','username' |
|
18 | + 'name', 'email', 'password', 'username' |
|
19 | 19 | ]; |
20 | 20 | |
21 | 21 | /** |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | public function handle() |
30 | 30 | { |
31 | 31 | $this->createAdminUser(); |
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 | } catch (\Illuminate\Database\QueryException $exception) { |
49 | 49 | } |
50 | 50 | } |
@@ -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 | } catch (\Illuminate\Database\QueryException $exception) { |
23 | 23 | } |
24 | 24 | } |
@@ -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 | /** |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if ($this->username() === 'email') { |
72 | 72 | return $this->attemptLoginAtAuthenticatesUsers($request); |
73 | 73 | } |
74 | - if (! $this->attemptLoginAtAuthenticatesUsers($request)) { |
|
74 | + if (!$this->attemptLoginAtAuthenticatesUsers($request)) { |
|
75 | 75 | return $this->attempLoginUsingUsernameAsAnEmail($request); |
76 | 76 | } |
77 | 77 | return false; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | protected function attempLoginUsingUsernameAsAnEmail(Request $request) |
87 | 87 | { |
88 | 88 | return $this->guard()->attempt( |
89 | - ['email' => $request->input('username'), 'password' => $request->input('password')], |
|
89 | + [ 'email' => $request->input('username'), 'password' => $request->input('password') ], |
|
90 | 90 | $request->has('remember') |
91 | 91 | ); |
92 | 92 | } |
@@ -12,23 +12,23 @@ |
||
12 | 12 | // ->url('http://www.google.com', 'Google'); |
13 | 13 | //}); |
14 | 14 | |
15 | -Menu::macro('adminlteSubmenu', function ($submenuName) { |
|
16 | - return Menu::new()->prepend('<a href="#"><span> ' . $submenuName . '</span> <i class="fa fa-angle-left pull-right"></i></a>') |
|
15 | +Menu::macro('adminlteSubmenu', function($submenuName) { |
|
16 | + return Menu::new()->prepend('<a href="#"><span> '.$submenuName.'</span> <i class="fa fa-angle-left pull-right"></i></a>') |
|
17 | 17 | ->addParentClass('treeview')->addClass('treeview-menu'); |
18 | 18 | }); |
19 | -Menu::macro('adminlteMenu', function () { |
|
19 | +Menu::macro('adminlteMenu', function() { |
|
20 | 20 | return Menu::new() |
21 | 21 | ->addClass('sidebar-menu')->setAttribute('data-widget', 'tree'); |
22 | 22 | }); |
23 | -Menu::macro('adminlteSeparator', function ($title) { |
|
23 | +Menu::macro('adminlteSeparator', function($title) { |
|
24 | 24 | return Html::raw($title)->addParentClass('header'); |
25 | 25 | }); |
26 | 26 | |
27 | -Menu::macro('adminlteDefaultMenu', function ($content) { |
|
28 | - return Html::raw('<i class="fa fa-link"></i><span>' . $content . '</span>')->html(); |
|
27 | +Menu::macro('adminlteDefaultMenu', function($content) { |
|
28 | + return Html::raw('<i class="fa fa-link"></i><span>'.$content.'</span>')->html(); |
|
29 | 29 | }); |
30 | 30 | |
31 | -Menu::macro('sidebar', function () { |
|
31 | +Menu::macro('sidebar', function() { |
|
32 | 32 | return Menu::adminlteMenu() |
33 | 33 | ->add(Html::raw('HEADER')->addParentClass('header')) |
34 | 34 | ->action('HomeController@index', '<i class="fa fa-home"></i><span>Home</span>') |
@@ -2,13 +2,13 @@ |
||
2 | 2 | |
3 | 3 | namespace Acacha\AdminLTETemplateLaravel\Providers; |
4 | 4 | |
5 | -use Illuminate\Routing\Router; |
|
6 | -use Illuminate\Container\Container; |
|
7 | -use Illuminate\Support\ServiceProvider; |
|
8 | -use Creativeorange\Gravatar\Facades\Gravatar; |
|
9 | 5 | use Acacha\AdminLTETemplateLaravel\Facades\AdminLTE; |
10 | -use Creativeorange\Gravatar\GravatarServiceProvider; |
|
11 | 6 | use Acacha\AdminLTETemplateLaravel\Http\Middleware\GuestUser; |
7 | +use Creativeorange\Gravatar\Facades\Gravatar; |
|
8 | +use Creativeorange\Gravatar\GravatarServiceProvider; |
|
9 | +use Illuminate\Container\Container; |
|
10 | +use Illuminate\Routing\Router; |
|
11 | +use Illuminate\Support\ServiceProvider; |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Class AdminLTETemplateServiceProvider. |
@@ -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 | |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | $this->registerGravatarServiceProvider(); |
53 | 53 | } |
54 | 54 | |
55 | - if (config('auth.providers.users.field', 'email') === 'username' && |
|
55 | + if (config('auth.providers.users.field', 'email') === 'username' && |
|
56 | 56 | config('adminlte.add_nullable_username', true)) { |
57 | - $this->loadMigrationsFrom(ADMINLTETEMPLATE_PATH .'/database/migrations/username_login'); |
|
57 | + $this->loadMigrationsFrom(ADMINLTETEMPLATE_PATH.'/database/migrations/username_login'); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | if (!$this->app->routesAreCached()) { |
111 | 111 | $router = app('router'); |
112 | 112 | |
113 | - $router->group(['namespace' => Container::getInstance()->getNamespace().'Http\Controllers'], function () { |
|
113 | + $router->group([ 'namespace' => Container::getInstance()->getNamespace().'Http\Controllers' ], function() { |
|
114 | 114 | require __DIR__.'/../Http/routes.php'; |
115 | 115 | }); |
116 | 116 | } |
@@ -5,7 +5,7 @@ |
||
5 | 5 | * but take into account we have to add 'web' middleware group here because Laravel by defaults add this middleware in |
6 | 6 | * RouteServiceProvider |
7 | 7 | */ |
8 | -Route::group(['middleware' => 'web'], function () { |
|
8 | +Route::group([ 'middleware' => 'web' ], function() { |
|
9 | 9 | // Route::auth(); |
10 | 10 | |
11 | 11 | Route::get('/home', 'HomeController@index'); |