How do I redirect my login link to show the landing page when someone logs into his account

I have two login links that appears on the navbar and the other one appears when a user clicks on the checkout button. configured the links at the logincontroller for the checkout page to be like this.

 protected function authenticated(Request $request, $user)
{ if(Auth::user()->userType == 'admin'){
return redirect('/admin')->with('status','Welcome');
return redirect()->back()->with('status','Welcome');

As you can see, when the user is at the checkout page and manages to login to his account, he gets redirected to the same checkout page.I want the other login link to redirect the users to the landing page, but the users are redirected to the home page as shown in the url.

How can I change this a redirect them to the landing page which is ‘’ If you’re an expert with laravel, can you assist? It’s an ecommerce application.

from Newest questions tagged laravel-5 – Stack Overflow

Related Posts

Codeigniter : Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE) in Laravel project

I’m getting following error: **Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE)** Note : It’s working in local but facing issue in production server. private…

Firebase receive notification while tab is active or on focus

What i want is to be able to perform an action when a user receives a notification while the browser is open and tab is active or…

Laravel’s alias loader does not find class

We have a legacy project that we cannot update and we need to make some changes in symfony’s Response.php in vendor. We have solved this by copying…

Laravel 5 – generic document management

I have a system where you can create different types of unique documents. For instance, one document is called Project Identified and this expects certain inputs. Originally,…

Laravel Nova limit the results in indexQuery

I ran intro a situation where I need to limit the results of a resource to only 3 results. To be more specific, based on the logged…

Auditoria en laravel 5.8 [closed]

Cómo puedo automatizar el registro de actividades de un usuario en laravel? Si un usuario ingresa a un app de laravel, debo guardar toda su actividas, a…

Leave a Reply

Your email address will not be published.