Laravel 7/ 6 Disable Register URL Example

Laravel 6 , Laravel , Laravel 7

Nicesnippets

1452

05-02-2020


Hi Guys

In this blog, I will explain to how to disable registration route in laravel 7/ 6. We can also register remove Authentication Routes from route file.i will disable register create custom route in laravel 7/ 6.

We will used register for default Auth::routes() in my web.php file. I Will used to auth remove register routes from route file.you can easy to disable register.

Here the following example of disable register

Example: 1

Now this example in register false for add in auth route in create in web.php('routes/web.php') file.

following path:/routes/web.php

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

Example: 2

Here this example in register disable for add in custom route in create in web.php('routes/web.php') file.

following path:/routes/web.php

// Authentication Routes...

Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');

Route::post('login', 'Auth\LoginController@login');

Route::post('logout', 'Auth\LoginController@logout')->name('logout');

// Registration Routes...

Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');

Route::post('register', 'Auth\RegisterController@register');

// Password Reset Routes...

Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');

Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');

Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');

Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');

// Email Verification Routes...

Route::get('email/verify', 'Auth\VerificationController@show')->name('verification.notice');

Route::get('email/verify/{id}', 'Auth\VerificationController@verify')->name('verification.verify');

Route::get('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');

It will help you...


Recommended Posts