State of multiple toggle buttons

I have multiple dynamically generated toggle buttons, I need to get the state of all of the toggle buttons that are selected. Using afterStateUpdated I can only get the state of the current selected toggle button but I need to know the state(selection) of any other toggled buttons. Anything else I can pass to the function? ->afterStateUpdated(function (Set $set, Component $component, ?string $state)
2 Replies
awcodes
awcodes5mo ago
$livewire, can probably get the data from that. Or access it from the $component->getLivewire()
FilaFan
FilaFanOP5mo ago
thanks @awcodes I will look into livewire, I'm still newish to livewire, will also try getLivewire() That did it, thank you @awcodes ->afterStateUpdated(function (Set $set, Component $component, ?string $state) { $livewireComponent = $component->getLivewire(); // Extract the data array $data = $livewireComponent->data;
Want results from more Discord servers?
Add your server