The make:auth command can be used to generate login and registration views, a basic HomeController controller and routes that can be used for basic authentication tasks. It accepts the optional flag --views which can be used to only generate the view files. The following views will be created (all paths are relative to the applications resources/views directory):
auth/login.blade.phpauth/register.blade.phpauth/passwords/email.blade.phpauth/passwords/reset.blade.phpauth/emails/password.blade.phplayouts/app.blade.phphome.blade.phpwelcome.blade.php
The following controller file will also be created:
app/Http/Controllers/HomeController.php
The following entry will also be added to the app/Http/routes.php routes file:
1Route::group(['middleware' => 'web'], function () {
2 Route::auth();
3
4 Route::get('/home', 'HomeController@index');
5});
Running this command will overwrite any changes made to any view or controller files with the same name. Running this command multiple times will also create multiple the HomeController route entries.
The following examples demonstrate how to call the make:auth command:
1# Run the command with default options.
2php artisan make:auth
3
4# Only generate authentication views.
5php artisan make:auth --views
∎