Livewire - Don't understand how it works

Hello, I'm trying to make a field that allows me to add a promo code to a table of "extras and discounts". I would like (as in the attached screenshot) to have a text field with a button to validate the promo code. When the button is clicked, a row should be added to the discount table with the data of the promo code. How can I do this?
4 Replies
krekas
krekas2y ago
you need to use compinabatin of validateOnly and $set
Zeldroxe
ZeldroxeOP2y ago
Thank you for your answer. Can you give me an example? I don't really understand how I can do this by adding a button
krekas
krekas2y ago
button is an action button so in that action you need to do all the logic search here on discord you will find similar answers
Dan Harrin
Dan Harrin2y ago
the button can be a “suffixAction()” if you specifically search for examples of that
Want results from more Discord servers?
Add your server