anonymouse703's avatar

How to redirect user to article page when login?

Hi! I'm using the new Laravel 12 + Vue starter. I created a news portal with Welcome.vue and Article.vue. I want that user must be login before it can bookmark an article.

When the user login instead redirecting to dashboard it will redirecting to article page.

0 likes
3 replies
Shivamyadav's avatar

You can directly redirect to the user after he gets logged into the application..

Like this

public function store(LoginRequest $request)
{
    $request->authenticate();

    $request->session()->regenerate();

   // return redirect()->intended('/dashboard'); // instead of this use below one
	return redirect()->intended('/article'); // if want a particular article then use the id / slug 
}

Please or to participate in this conversation.