Is it correct that dispatching events will only work with events names that don't have uppercases? #2308
-
I've been working with Alpine's magic $dispatch property lately. It's really great how easy to use it it. One thing that I noticed (after almost going crazy) is that events like This made me wonder whether it's indeed the use of capitals here that does it. Is that true? If it's true, perhaps it would be an idea to add this to the docs, so that other Laravel developers used to using camelCase don't have to figure this out 😁 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It's not true. Dispatch can dispatch any event. Browser attributes are case insensitive and always considered lowercase (it's also in the docs) so you can't write @CustomEvent. |
Beta Was this translation helpful? Give feedback.
-
Ah, I totally missed the |
Beta Was this translation helpful? Give feedback.
It's not true. Dispatch can dispatch any event. Browser attributes are case insensitive and always considered lowercase (it's also in the docs) so you can't write @CustomEvent.
You probably want to have a look at the camel modifier in the docs as well.