By partially you mean accessing just item1 for example? Have you tried this:
<Link href="/items" :only="['nested.item1']">Show items 1</Link>
using the . syntax.
Give some example on what you tried and what you want to achieve.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi. How to use inertia partial reload when returning response with a nested array:
return Inertia::render('InertiaTestPage', [
...
'test' => Inertia::lazy(fn () => 'bcda1'),
'go' => Inertia::lazy(fn () => 'abc'),
'nested' => [ // how to do this?
'item1' => Inertia::lazy(fn () => 'abc'),
'item2' => Inertia::lazy(fn () => 'def'),
],
...
]);
If possible, how to partial load this from frontend?
Thanks!
@ammarsdc got it. Yeah, tried it myself now, and it is as you said. I am not sure if that will ever be the plan, because in my opinion, I wouldn't nest something which does not belong in a group, or is doing any heavy computation. Those can be separate items, which then can be separately lazy loaded. I will group in a lazy loaded array, everything that needs to load for a specific link/page.
But again, this is only my opinion, not sure what is your use case, and what will this particular case improve.
And sorry, but I don't have anyone in mind that I can tag, I know that I am not the only one that has seen this post, so maybe someone will respond, or better yet, open this as an issue on Inertia github, with the last thing that you wrote here, and you will receive a proper answer, if it is intended to work as it does, or is there any plan to consider what you need.
Please or to participate in this conversation.