laravel login user email code example

Example 1: laravel using username instead of email

All we need is add a method in app/Http/Controllers/Auth/LoginController.php:

/**
 * Get the login username to be used by the controller.
 *
 * @return string
 */
public function username()
{
    return 'username';
}

Example 2: log email laravel

This is in your Mail.php config file...

When using
  
'driver' => env('MAIL_DRIVER', 'log'),

This will get the MAIL_DRIVER environment variable set in your .env file. In
this case, 'log' is used only as a default if a value is not specified in your.
env file... Your .env file probably has this still set in it. set it to log.

MAIL_DRIVER=smtp
  
#### replace with ####

MAIL_DRIVER=log

Tags:

Php Example