search

Home  >  Q&A  >  body text

What is the purpose of adding `name('register')` after Laravel routing?

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

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

reply all(2)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 16:51:14

    Route name, easy to generate url

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-16 16:51:14

    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.

    reply
    0
  • Cancelreply