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

cuttlefish's avatar

restore search params on page back

Hi everyone, I'm creating a real estate application where the main page consists of a classic search menù with search parameters on the left, and search results on the right. Search results are displayed through VueJs: when search parameters change, the results on the right are rendered accordingly.

Then, when one of the results is clicked, the application goes to details page (that's a different route, with a different laravel blade template, classic php no Vue).

The problem is this: from the details page, when clicking on the back button, of course all previous search parameters are lost. Instead I need to go back with search parameters set, just like coming from an old form postback.

The only solution I came up with is to store all search params in session, check for this data in the controller and somehow send them to the component.

Any better solution? Thank you.

0 likes
2 replies
cuttlefish's avatar

I'm new to VueJs world, didn't know about state. Thank you, I'll give it try.

Please or to participate in this conversation.