php artisan make:auth
. If you’ve got a brand new app with nothing crazy going on, run that command, run migrations, and you’re pretty much all set. The appropriate auth database tables, views, controllers, and routes get magically inserted into your code. Yay!Auth::routes();
bit that Laravel adds into your routes/web.php
file is magical, in that no actual controllers, methods, or request URLs defined. It’s just Auth::routes();
. This means figuring out where to override all or some of them can be confusing. What if you want to put your views in a different location than the default ones they generate? What if you want to use most of the built-in logic, but want to tweak it a little beyond just modifying the blades that were generated for you? It’s not at all hard, but it can be confusing.php artisan route:list
after generating your auth files, you can see the new auth routes that Laravel has created for you.php artisan make:auth
in a brand new app: Kaspersky internet security 2014 activation key generator.php artisan make:auth
:Auth
controllers files that Laravel created for you. Go ahead and open up your Auth/LoginController.php
, and you’ll see something like this:use IlluminateFoundationAuthAuthenticatesUsers;
and use AuthenticatesUsers;
.ForgotPasswordController.php
, which looks like this:IlluminateFoundationAuthSendsPasswordResetEmails;
and use SendsPasswordResetEmails;
, which tells the controller to use the built-in Laravel trait called SendsPasswordResetEmails
that lives in IlluminateFoundationAuthSendsPasswordResetEmails.php;
.vendor/laravel/framework/src/Illuminate/Foundation/Auth
. You’ll see several files in this directory that are named things like AuthenticatesUsers.php
, and SendsPasswordResetEmails.php
. These are the traits you use in your Auth controllers. If you don’t specify them in your controllers, the default methods in the traits kick in, and you don’t really have to do much. If, however, you want to override some or all of the auth stuff, you’ll add methods of the same name to the corresponding controller.SendsPasswordResetEmails
trait in vendor/laravel/framework/Illuminate/Foundation/Auth/SendsPasswordResetEmails .php
:AppHttpControllersAuthForgotPasswordController@showLinkRequestForm
, but that (of course) doesn’t exist in the controller itself.SendsPasswordResetEmails
trait in vendor/laravel/framework/Illuminate/Foundation/Auth
::app/Http/Controllers/Auth/ForgotPasswordController.php
file that Laravel generated for us when we ran php artisan make:auth
, and add something like this:use Log;
at the top of the file.)storage/logs/laravel.log
file:[2016-11-18 21:12:54] local.DEBUG: a user has clicked on the forgotten password link
use SendsPasswordResetEmails;
bit at the top of your ForgotPasswordController.php to something like this: