我想将注册链接更改为domain.com/register?ref=abc 如何在laravel 5.5中做到这一点?
<a style="margin-bottom: 5px;font-size: 17px;font-weight: 600;" href="{{ route('login') }}" class=""><i class="fa fa-sign-in"></i> Log In</a>
<a style="margin-bottom: 5px;font-size: 17px;font-weight: 600;" href="{{ route('register') }}" class=""><i class="fa fa-user-plus"></i> Registration</a>
答案 0 :(得分:1)
auth
路由:您可以通过点击routes/web.php
并根据需要更改默认身份验证路由来覆盖默认身份验证路由:
{
// 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');
}
您可以省略named routes
并使用直接链接:
<a style="margin-bottom: 5px;font-size: 17px;font-weight: 600;" href="http://example.com/register?ref=abc" class=""><i class="fa fa-user-plus"></i> Registration</a>
<a style="margin-bottom: 5px;font-size: 17px;font-weight: 600;" href="{{ route('register') }}/?ref=abc" class=""><i class="fa fa-user-plus"></i> Registration</a>
希望有所帮助