在laravel学习认证路线的困难

问题描述 投票:0回答:1

在laravel 5.5中的身份验证中,它提供自动用户登录和注册表单。但是当我点击登录表单中的登录按钮时,它会显示路线('登录')。

我不知道这是什么意思。同样,在登记和其他情况下也是如此。任何的想法?

php laravel
1个回答
0
投票

Auth::routesRouter::auth method,其代码如下:

/**
* Register the typical authentication routes for an application.
*
* @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')->name('password.request');
    $this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
    $this->get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
    $this->post('password/reset', 'Auth\ResetPasswordController@reset');
}

因此,正如您在上面所看到的,命名路由login指的是显示登录表单的get调用。

© www.soinside.com 2019 - 2024. All rights reserved.