Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to authenticate register route in Laravel 8 Jetstream?

I want to disable access to register route without login in laravel 8. I am using laravel jetstream with livewire. Here is code in routes\web.php. I have not changed anything in route file.

Route::get('/', function () {
    return view('welcome');
});

Route::middleware(['auth:sanctum', 'verified'])->get('/dashboard', function () {
    return view('dashboard');
})->name('dashboard');
like image 892
Sharful Islam Avatar asked Nov 23 '25 22:11

Sharful Islam


1 Answers

To disable registration go to config/fortify.php and comment out Features::registration().

'features' => [ 
    //Features::registration(),
    Features::resetPasswords(),
    // Features::emailVerification(),
    Features::updateProfileInformation(),
    Features::updatePasswords(),
    Features::twoFactorAuthentication(), 
],
like image 176
anasmorahhib Avatar answered Nov 25 '25 11:11

anasmorahhib



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!