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

twg_'s avatar
Level 6

Show hide divs dynamically

So I have a quiz I'm building and I've run into a small issue when it comes to clicking my next button.

I have a variable set on my livewire component called $nextQuestion. In my view I'm trying to do the following but it's not putting the value in the page I want it.

@click="question_{{ (int)$key }}: false; question_$wire.nextQuestion: true;"

I was expecting this to return @click="question_1: false; question_2: true;" the question_1:false works just fine. The part I'm having issues with is using question_$wire.nextQuestion: true doesn't actually put the integer in the place of $wire.nextQuestion.

0 likes
0 replies

Please or to participate in this conversation.