Laravel Disable Register URL Example

Laravel Disable Register URL Example

Laravel Disable Register URL Example

Hi Guys

Today, I will learn to how to disable registration route in laravel. We can also register remove Authentication Routes from route file.i will disable register create custom route in laravel.

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...

No comments:

Post a Comment