3

I am working on a project using Laravel 5 and I am trying to figure out how to reset passwords. I know the migration for the password resets is already there but I remember there was a ReminderController in Laravel 4 which I could generate but I cannot find the same in Laravel 5.

I am sure that Laravel 5 ships with a password reset mechanism but I cannot exactly figure out where to send the request and the method which handles sending the emails?

I can find the views and the migration but can anyone help me find the controller method and route. If anyone can provide me with a tutorial, I could work with that too.

7
  • Perhaps you should start with the docs: laravel.com/docs/5.0/… Commented May 15, 2015 at 18:48
  • I did. I still have a few doubts. Commented May 15, 2015 at 18:53
  • Perhaps you should be a bit more specific in your question then. What exactly are your doubts? Where did you get stuck? Commented May 15, 2015 at 18:55
  • Okay, I found the ResetsPasswords trait which is responsible for the logic and methods and I also found the postEmail method and realized that I have to send th request with the email to /password/email. I am using it but the email is not sent. I have all my settings for mail done right. Activation emails are being sent correctly. Any idea about that? Commented May 15, 2015 at 19:14
  • Okay they were just queued up. Delivered. Got it. Thanks. Commented May 15, 2015 at 19:17

1 Answer 1

3

Laravel also includes an

Auth\PasswordController 

that contains the logic necessary to reset user passwords. We've even provided views to get you started! The views are located in the

resources/views/auth 

directory. You are free to modify these views as you wish to suit your own application's design.

Your user will receive an e-mail with a link that points to the 

getReset method 

of the

PasswordController. 

This method will render the password reset form and allow users to reset their passwords. After the password is reset, the user will automatically be logged into the application and redirected to /home. You can customize the post-reset redirect location by defining a redirectTo property on the PasswordController:

protected $redirectTo = '/dashboard';

Source

Sign up to request clarification or add additional context in comments.

4 Comments

In my L 5.1 instance there are no auth folder in resources/views/ and there are no method called getReset in PasswordController. PasswordController contains only the construction, What will i do now?
I had the same problem. Turns out, i was reading the documentation for Laravel 5.0 instead of 5.1. The Laravel 5.1 auth documentation explains everything in detail. laravel.com/docs/5.1/authentication
How did you set up the routes for those methods?
Update: just add routes to cover the methods in Illuminate\Foundation\Auth\ResetsPasswords

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.