@cytisay Try this:
return redirect()->intended($url)->with('user_name', $user_name);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
My goal is to pass the name of the user after a successful login so I can display it on the dashboard page. Here's the line of code that causes the error which is inside the AuthenticatedSessionController:
$user_name = Auth::user()->name;
return redirect()->intended($url, compact('user_name'));
Is there other way to display the user's information after logging in? I am using Laravel + Inertia + VueJS and Vuetify. Please help.
@cytisay try $page.props.user.name from what I remember. Those properties are in the middleware HandleInertiaRequests
Please or to participate in this conversation.