diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/PasswordController.php index 3106193591ce..3741a8157983 100644 --- a/app/Http/Controllers/Auth/PasswordController.php +++ b/app/Http/Controllers/Auth/PasswordController.php @@ -20,6 +20,8 @@ class PasswordController extends Controller { use ResetsPasswords; + protected $redirectTo = '/dashboard'; + /** * Create a new password controller instance. * diff --git a/app/Http/routes.php b/app/Http/routes.php index 0675fbe21180..52d83cf57e59 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -66,8 +66,10 @@ post('/signup', array('as' => 'signup', 'uses' => 'Auth\AuthController@postRegis get('/login', array('as' => 'login', 'uses' => 'Auth\AuthController@getLogin')); post('/login', array('as' => 'login', 'uses' => 'Auth\AuthController@postLogin')); get('/logout', array('as' => 'logout', 'uses' => 'Auth\AuthController@getLogout')); -get('/forgot', array('as' => 'forgot', 'uses' => 'Auth\AuthController@getLogin')); -post('/forgot', array('as' => 'forgot', 'uses' => 'Auth\AuthController@postLogin')); +get('/forgot', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@getEmail')); +post('/forgot', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@postEmail')); +get('/password/reset', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@getReset')); +post('/password/reset', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@postReset')); /* // Confide routes diff --git a/database/migrations/2015_03_30_100000_create_password_resets_table.php b/database/migrations/2015_03_30_100000_create_password_resets_table.php new file mode 100644 index 000000000000..679df38f8838 --- /dev/null +++ b/database/migrations/2015_03_30_100000_create_password_resets_table.php @@ -0,0 +1,33 @@ +string('email')->index(); + $table->string('token')->index(); + $table->timestamp('created_at'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('password_resets'); + } + +} diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index cd5993158e7d..3e68c0ea9499 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -65,10 +65,10 @@ {!! Former::password('password')->placeholder(trans('texts.password'))->raw() !!}
-{!! Button::primary(trans('texts.lets_go'))->withAttributes(array('class' => 'btn-lg'))->submit()->block() !!}
+{!! Button::success(trans('texts.lets_go'))->withAttributes(array('class' => 'btn-lg'))->submit()->block() !!}
- {!! link_to('forgot_password', trans('texts.forgot_password')) !!} + {!! link_to('/forgot', trans('texts.forgot_password')) !!}
diff --git a/resources/views/users/forgot_password.blade.php b/resources/views/auth/password.blade.php similarity index 77% rename from resources/views/users/forgot_password.blade.php rename to resources/views/auth/password.blade.php index 4393ecec83f3..c2f563b030b1 100644 --- a/resources/views/users/forgot_password.blade.php +++ b/resources/views/auth/password.blade.php @@ -53,7 +53,7 @@ @section('body'){!! Button::normal(trans('texts.send_email'))->withAttributes(array('class' => 'btn-lg'))->submit()->block() !!}
+{!! Button::success(trans('texts.send_email'))->withAttributes(array('class' => 'btn-lg'))->submit()->block() !!}
+ + @if (count($errors->all())) +- {{ Former::password('password')->placeholder(trans('texts.password'))->raw() }} - {{ Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->raw() }} + {!! Former::text('email')->placeholder(trans('texts.email'))->raw() !!} + {!! Former::password('password')->placeholder(trans('texts.password'))->raw() !!} + {!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->raw() !!}
-{{ Button::success_submit(trans('texts.save'), array('class' => 'btn-lg'))->block() }}
+{!! Button::success(trans('texts.save'), array('class' => 'btn-lg'))->submit()->block() !!}
+ + + @if (count($errors->all())) +- {{ $errors->first('login_email') }} - {{ $errors->first('login_password') }} -
- -- {!! Former::text('login_email')->placeholder(trans('texts.email_address'))->raw() !!} - {!! Former::password('login_password')->placeholder(trans('texts.password'))->raw() !!} -
- -{!! Button::primary(trans('texts.lets_go'))->withAttributes(array('class' => 'btn-lg'))->submit()->block() !!}
- -- {!! link_to('forgot_password', trans('texts.forgot_password')) !!} -
- - - @if (Session::has('warning')) -