How do I use a Toogle to hide/show an Input?

So I have a toogle component and an input component, pretty straight forward. I want to show or hide the input base on the toogle state Toggle::make('Agregar bordado?')->inline(), TextInput::make('embroidery') ->label("Texto de bordado"), I thought on add reactive(), save the boolean state of the toogle, and check on the input that boolean value but that seems extremely complicated for a single action. Is there any way to do this without saving the value?
2 Replies
awcodes
awcodes2y ago
You’re on the right track but you don’t have to save it. Make the toggle reactive and ->visible(fn($get) => $get(‘toggle name’)) on the input.
barrerakj
barrerakjOP2y ago
Awesome, thanks!
Want results from more Discord servers?
Add your server