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

ArchStanton's avatar

View composers with logic

Hi,

I have a 5 step quiz. I have a navigation as a partial and want to pass in the links depending on which page the user is on.

So on step2 the back link will go to step1. The next link to step3. So on step3 the back link will go to step2. The next link to step4.

I was thinking about using View composers, but I also need some logic to determine the page the user is on and the links that should be sent to the view.

Anyone got any ways how this can best be achieved? My initial idea was to just send them to the view via the router ?

Any suggestions would be appreciated.

0 likes
0 replies

Please or to participate in this conversation.