What is the purpose of adding `name('register')` after Laravel routing?
伊谢尔伦
伊谢尔伦 2017-05-16 16:49:14
0
2
618

What is the function of the following route followed by name('register')?

$this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(2)
过去多啦不再A梦

Route name, easy to generate url

给我你的怀抱

The

where method constrains the parameters passed in by the previous route, such as

Route::get('user/{name}', function ($name) {
    //
})
->where('name', '[A-Za-z]+');

The previous name parameter must match the following regular expression to call the following callback function.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template