How to disable registration new users in Laravel

后端 未结 27 2916
鱼传尺愫
鱼传尺愫 2020-12-07 10:34

I\'m using Laravel (v5).

I need one user and I\'ve already registered that. Now I want to disable registration for new users. Of course, I need the login form to wor

27条回答
  •  醉话见心
    2020-12-07 11:16

    As of Laravel 5.7 you can pass an array of options to Auth::routes(). You can then disable the register routes with:

    Auth::routes(['register' => false]);
    

    You can see how this works from the source code: src/Illuminate/Routing/Router.php.

提交回复
热议问题