Laracast13's avatar

how disable registration in laravel/breeze ?

Hi, Using breeze for laravel

composer require laravel/breeze --dev
php artisan breeze:install

how can disable access on registration route and do not allow anyone make registration ?

0 likes
8 replies
tykus's avatar

Remove the register related routes from the routes/auth.php file

1 like
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 RegisteredUserController controller.

4 likes
Laracast13's avatar

Hi

In which file is this routes? in web.php there is not such routes

tykus's avatar

I already explained to you that you remove these routes from the routes/auth.php file @www888

bobbybouwmann's avatar

Laravel Breeze is nothing more than a scaffolding tool. If you want to turn off registration you need to remove some stuff yourself:

  • Remove registration routes in routes/auth.php
  • Remove controller in app/Http/Controllers/Auth/RegisteredUserController.php
  • Remove the view in resources/views/auth/register.blade.php

In your case removing the routes is already enough, but for a good clean up the rest is required as well ;)

5 likes
ailyye's avatar

You can redirect the /register route to /login in web.php Route::redirect('/register', '/login');

*must be after Auth::routes(); *

Please or to participate in this conversation.