在 php artisan make:auth 之后理解 Auth::routes()

Understanding Auth::routes() after php artisan make:auth

Laravel 提供了注册控制器,Auth::routes() 定义了这个控制器的使用。我去了 Router.php 中的 auth() 函数,发现在注册路由时调用注册控制器中的注册函数,

$this->post('register', 'Auth\RegisterController@register');

但是我在 RegisterController 文件中找不到这个注册函数。这里发生了什么?我错过了什么吗?我是 laravel.

的新手

RegisterController 使用名为 Illuminate\Foundation\Auth\RegistersUsers 的特性,您可以在其中找到 register() 方法。

查看 Laravel 的源代码 here

阅读更多关于特征的信息 here