Laravel Remove Register Route Example

Laravel 6 , Laravel , Laravel 7

Nicesnippets

637

03-06-2020


Hi Guys.

In this example,I will learn you how to remove register route in laravel, you can simply and easy to remove register route.

As we know laravel provide Auth::routes() for all login, registration, reset password and email verification. You can use default following routes lists instead of Auth::routes().

Create Route

Auth::routes();

to:

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

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

Modify Controller

Open AuthController or RegisterController simply modify showRegistrationForm() and register() methods.

public function showRegistrationForm()

{

return redirect('login');

}

public function register()

{

// empty

}

It will Help you...


Recommended Posts