Laravel Disable Registration Route Example

Laravel Disable Registration Route Example

In this post we will give you information about Laravel Disable Registration Route Example. Hear we will give you detail about Laravel Disable Registration Route ExampleAnd how to use it also give you demo for it if it is necessary.

In this small post, i would like to show you how to disable register route in laravel. if you can disable register route in laravel application. if you have question about how to remove register route in laravel then you are a right place.

You can disable registration route in laravel 5 and laravel 6 application.

I will give you two way to remove register route in laravel. laravel provide by default auth routes and they create login, register, forgot passwords routes but you can easily do it using “Auth::routes([‘register’ => false]);”.

So let’s see both way how to remove register route in laravel application.

Example 1:

Here, we will use default auth routes with pass array as argument and pass ‘register’ false so they will disabled register route in laravel app.

So, you can do it like as bellow:

routes/web.php

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

You can also disabled ‘reset’ and ‘verify’ as like bellow:

Auth::routes([

'register' => false, // Register Routes...

'reset' => false, // Reset Password Routes...

'verify' => false, // Email Verification Routes...

]);

Example 2:

Here, we will create all manually routes in our web.php file instead of they provide auth:routes(). Then you can remove it as you don’t required anything. so you can see bellow listed default routes and you can remove any that you not required.

So, you can do it like as bellow:

routes/web.php

/* Authentication Routes... */

Route::get('login', 'AuthLoginController@showLoginForm')->name('login');

Route::post('login', 'AuthLoginController@login');

Route::post('logout', 'AuthLoginController@logout')->name('logout');

/* Registration Routes... */

Route::get('register', 'AuthRegisterController@showRegistrationForm')->name('register');

Route::post('register', 'AuthRegisterController@register');

/* Password Reset Routes... */

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

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

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

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

/* Email Verification Routes... */

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

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

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

I hope it can help you…

Hope this code and post will helped you for implement Laravel Disable Registration Route Example. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

5  +  4  =  

We accept paid advance and paid guest Posting on our Site : Contact US