close slash register in laravel 8

469 1 0 0

Last Updated : 2024-05-02 18:16:48

how to close /login in laravel 8

this process in laravel 8 located in :

vendor/laravel/fortify/src/Http/Controllers/RegisteredUserController.php

change this section


/**
* Show the registration view.
*
* @param \Illuminate\Http\Request $request
* @return \Laravel\Fortify\Contracts\RegisterViewResponse
*/
public function create(Request $request): RegisterViewResponse
{
return app(RegisterViewResponse::class);
}

this will redirest /register to show login form ... so we need to delete RegisterViewResponse class from create function and replace return to where we want like this


/**
* Show the registration view.
*
* @param \Illuminate\Http\Request $request
* @return \Laravel\Fortify\Contracts\RegisterViewResponse
*/
public function create(Request $request)
{
//return app(RegisterViewResponse::class);
// engsahaly - modify register redirection
// don't forget to delete RegisterViewResponse from create function
return redirect()->route('homePage');
}

 

Mahmoud Anwar

Mahmoud Anwar

Back End Developer with a passion for developing innovative web applications that expedite the efficiency and effectiveness of organizational success. Well-versed in technology and writing code to create systems that are reliable and user-friendly. Also has the proven ability to motivate, educate, and collaborate effectively to build web applications and effectively track changes. Confident communicator, strategic thinker, and innovative creator to develop software that is customized to meet a company’s organizational needs, highlight their core competencies, and further their success.