Laravel Episode 6: Password Reset and Email


episode 6

Episode 6: Password Reset and Email

 

  • Move Login/Logout link to the navbar
  • Add password help link to login page
  • Configure .env to work with mailtrap.io
  • Add value to from so that there is a sent from value. Good idea to use env('FROM_EMAIL')
  • Modify route file with the following
// Password reset link request routes
Route::get('password/email', 'AuthPasswordController@getEmail');
Route::post('password/email', 'AuthPasswordController@postEmail');

// Password reset routes...
Route::get('password/reset/{token}', 'AuthPasswordController@getReset');
Route::post('password/reset', 'AuthPasswordController@postReset');
  • Review /Http/Controllers/Auth/PasswordController.php and add the following
use IlluminateHttpRequest;
use IlluminateMailMessage;
use IlluminateSupportFacadesPassword;

use DB;

protected $redirectTo = '/';

public function getEmail() {
	// code here
}

public function postEmail(Request $request) {
	// code here
}

public function getReset($token) {
	// code here
}
  • postReset() is already configured and does not need modification for this demo
  • Create view files
    • auth/password.blade.php
    • auth/reset.blade.php
    • emails/password.blade.php
  • Review /config/auth.php file. Look at the emails.password setting
Share the Post:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts

Photo of R1S with axe

Rivian R1 Dual Standard Is Gone: New Starting Prices, Last Lease Deals, and the R2 Launch

Rivian has officially confirmed the end of the Dual Standard configuration for the R1T and R1S, raising the entry price by $7,000 across the board. Between LFP battery calibration failures, the upcoming R2 reveal, and a potential pricing strategy shift, there’s a lot more going on here than a simple trim cut. Here’s what it means for buyers — and what it could signal about where Rivian is headed.

Read More