No built-in feature for this. Not sure why would you use different template files. I would rewrite that so it uses the same root view.
Jul 19, 2021
1
Level 9
Inertia switch rootView conditionally
Hello everyone
I'm using inertia with Vue in Laravel 8 app. and I have two blade layout files. guest.blade.php for auth components and app.blade.php for anything else.
As mentioned in the docs, I can set rootView blade layout file to be rendered as bellow.
public function rootView(Request $request): string
{
if ($request->route()->getPrefix() !== '/auth') {
return 'app';
}
return 'guest';
}
when I go to /auth/login it renders guest.blade.php. but after login and redirect to /dashboard it keeps the old layout file instead of app.blade.php and only render it when I refresh the page.
any solution to this problem.
Please or to participate in this conversation.