Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rhand's avatar
Level 6

Jetstream Inertia Home Link

How can we add a link to root domain or home in Laravel Jetstream with Inertia ? Tried welcome using name of component, tried / without route() but that caused errors:

Error parsing JavaScript expression: Unterminated regular expression. (1:2)

Just want

<!-- Navigation Links -->
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
    <NavLink :href="route('dashboard')" :active="route().current('dashboard')">
        Home
    </NavLink>
</div>

to be replaced by link to home. How can that be done in Jetstream using Inertia?

0 likes
2 replies
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58

To add a link to the root domain or home in Laravel Jetstream with Inertia, you can use the route() helper function with the name of the route that points to the home page. If you don't have a named route for the home page, you can create one in your routes/web.php file like this:

Route::get('/', function () {
    return Inertia\Inertia::render('Welcome');
})->name('home');

Then, in your Jetstream navigation links, you can use the route() helper function with the name of the home route like this:

<!-- Navigation Links -->
<div class="hidden space-x-8 sm:-my-px sm:ml-10 sm:flex">
    <NavLink :href="route('home')" :active="route().current('home')">
        Home
    </NavLink>
</div>

This will generate a link to the root domain that points to the home page of your application.

1 like
piljac1's avatar

Can you post what you tried in addition to what you posted? Because it should be pretty much straight forward. Either by putting href="/" or href="route('your_route_name')".

1 like

Please or to participate in this conversation.