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

demuth666's avatar

how to pass data in livewire

I have a page, before continuing to the next page the user must first select one of the data in the table. When he has selected, he will go to the next page. On the next page there will be data that has the same ID as the previous data ID. I want to add data but how do I get the data id beforehand

0 likes
5 replies
vincent15000's avatar

It seems to be like a form in several steps, each step on a different page.

Why not storing the selected data into the session ?

Merklin's avatar

Or use query parameters in the URL.

1 like
Merklin's avatar

@vincent15000 If it is a tabbed form - yes. But the OP is saying that he goes to a new page. In this case, query parameters can be used and retrieved as you wish.

1 like
vincent15000's avatar

@Merklin I would rather use sessions for that, or perhaps a context (Laravel 11 has a new feature : Context).

Please or to participate in this conversation.