I'm using Laravel + Inertia + React in my project and I define the rootView layout in the HandleInertiaRequests middleware, depending on which route is requested, like this:
public function rootView(Request $request)
{
if ($request->route()->getPrefix() == "/admin") {
return "adm";
} else {
return "app";
}
}
But I found a problem when redirecting from a route with app rootView to a route with adm rootView (from /login to /admin).
The problem is that the rootView is not changed before or after the redirect. Is there a way to force the redirection to reload the full page?