Illuminate\Routing\Router::auth PHP Method

auth() public method

Register the typical authentication routes for an application.
public auth ( ) : void
return void
    public function auth()
    {
        // Authentication Routes...
        $this->get('login', 'Auth\\LoginController@showLoginForm')->name('login');
        $this->post('login', 'Auth\\LoginController@login');
        $this->post('logout', 'Auth\\LoginController@logout')->name('logout');
        // Registration Routes...
        $this->get('register', 'Auth\\RegisterController@showRegistrationForm')->name('register');
        $this->post('register', 'Auth\\RegisterController@register');
        // Password Reset Routes...
        $this->get('password/reset', 'Auth\\ForgotPasswordController@showLinkRequestForm');
        $this->post('password/email', 'Auth\\ForgotPasswordController@sendResetLinkEmail');
        $this->get('password/reset/{token}', 'Auth\\ResetPasswordController@showResetForm');
        $this->post('password/reset', 'Auth\\ResetPasswordController@reset');
    }

Usage Example

 /**
  * Define the routes for the application.
  *
  * @param \Illuminate\Routing\Router $router
  */
 public function map(Router $router)
 {
     $router->middleware('dashboard', AccessMiddleware::class);
     $router->group(['middleware' => ['web', 'dashboard'], 'prefix' => 'dashboard', 'namespace' => $this->namespace], function ($router) {
         require __DIR__ . '/../Http/routes.php';
     });
     $router->group(['middleware' => ['web'], 'prefix' => 'dashboard', 'namespace' => $this->namespace], function ($router) {
         $router->auth();
     });
 }
All Usage Examples Of Illuminate\Routing\Router::auth