I personally think you can't do it because the doms you want to replace are outside inertia app.
Why you don't use layout as your frontend component or use inertia layout, just curious.
I have a website where I want to setup multiple layouts.
auth layout : for (login, register etc) pages
dashboard layout: for authenticated users to show dashboard and all other pages related to it there.
I have tried to change root view in controller but it didn't work
Inertia::setRootView('dashboard');
dashboard.blade.php : it contains sidebar for logged in users and have different style theme
<!doctype html>
...
<div class="rt-wrapper">
@include('partials.sidebar')
<main id="rt-main" class="rt-main rt-haslayout">
<div class="rt-dashboard">
@inertia
</div>
</main>
</div>
...
</html>
auth.blade.php : it only contains login, register etc pages and no sidebar with different style theme.
<!doctype html>
...
<div class="rt-wrapper rt-wrappernopadding">
<div class="rt-loginpagewrapper">
@inertia
</div>
</div>
...
</html>
Please or to participate in this conversation.