SarahS's avatar
Level 12

Remove registration from Laravel Breeze

I'm setting up a CMS but I only need one user, me, and now I want to disable registration. What is the best way to go about it in Breeze?

0 likes
4 replies
MichalOravec's avatar
Level 75

Remove this routes

Route::get('/register', [RegisteredUserController::class, 'create'])
                ->middleware('guest')
                ->name('register');

Route::post('/register', [RegisteredUserController::class, 'store'])
                ->middleware('guest');

And remove this controller RegisteredUserController

3 likes
newbie360's avatar

just one line in web.php, but don't know if this still work!!

Route

Auth::routes(['register' => false]);
1 like
jcs224's avatar

I just tried this, it doesn't work with Breeze. I get an error about needing the laravel/ui package.

viktort1t0's avatar

That line doesn't work anymore. With laravel breeze you have the routes in a different file. Just comment or erase the routes that you don't want to use anymore.

Please or to participate in this conversation.