Problem

I needed to generate new Auth routes.

This is what I used so far.

Auth::routes();


Route::get(‘/home’, ‘HomeController@index’);

Here is the weird thing, I run php artisan route:list, and I am seeing many actions, like LoginController@login...

However I didn’t find these actions in my AppHttpControllersAuth, where are these?

Also, what does the Auth::routes() stand for? I can’t find the routes about Auth.

I need someone help, thank you to answer my question

Solution

Auth::routes() is just a helper class that helps you generate all the routes required for user authentication. You can browse the code here https://github.com/laravel/framework/blob/5.8/src/Illuminate/Routing/Router.php instead.

Here are the routes

// Authentication Routes…

$this>get(‘login’, ‘AuthLoginController@showLoginForm’)>name(‘login’);

$this>post(‘login’, ‘AuthLoginController@login’);

$this>post(‘logout’, ‘AuthLoginController@logout’)>name(‘logout’);

// Registration Routes…

$this>get(‘register’, ‘AuthRegisterController@showRegistrationForm’)>name(‘register’);

$this>post(‘register’, ‘AuthRegisterController@register’);

// Password Reset Routes…

$this>get(‘password/reset’, ‘AuthForgotPasswordController@showLinkRequestForm’);

$this>post(‘password/email’, ‘AuthForgotPasswordController@sendResetLinkEmail’);

$this>get(‘password/reset/{token}’, ‘AuthResetPasswordController@showResetForm’);

$this>post(‘password/reset’, ‘AuthResetPasswordController@reset’);