[V2/V3] How to share Livewire validation with AlpineJs #3909
Replies: 3 comments 3 replies
-
With LiveWire 3, you should not be separately including Alpinejs. It is recommended you upgrade to Livewire v3 and see if the problem persists. |
Beta Was this translation helpful? Give feedback.
-
Hello, this is a great package and I'm currently trying this out in my project. I do have a question, I'm using this in my modal (laravel/breeze modal) which is in livewire component. How can I call the resetValidation or clear the error bag in this when I click on cancel or close button in the modal? I do apologize if I asked on the wrong thread. |
Beta Was this translation helpful? Give feedback.
-
@hans-lts . have you found the solution ? |
Beta Was this translation helpful? Give feedback.
-
In the last year or so I've really embraced (and have been loving) the relationship between AlpineJs and Livewire. The only thing I felt was missing was a clean interface between the Livewire's validation results and my Alpine components. I didn't want to rely on blade directives since that would occasionally cause some DOM diffing issues and, for me at least, it just felt "cleaner".
Anyway, I made a package for it which you can check out here.
My hope is that someone out there can find a use for this - enjoy!
Quick example (Livewire v3)
Install
Bundle
Livewire component
Blade
Result
Beta Was this translation helpful? Give feedback.
All reactions