Laravel provides with register controller and Auth::routes() defines the use of this controller. I went to auth() function in Router.php and found that upon registration route calls register function in register controller,
$this->post('register', 'Auth\RegisterController@register');
but I cannot find this register function in RegisterController file. What is happening here ? Am I missing something? I am new to laravel.
The RegisterController
uses a trait named Illuminate\Foundation\Auth\RegistersUsers
in which you will find your register()
method.
Check out in the Laravel's source code here.
Read more about trait here.