Closed mrlinnth closed 3 years ago
Hi,
What's being shared in this case, is the translation key: https://github.com/laravel/laravel/blob/ebf2646c347b941e63709f7e69ab79416f6d5124/resources/lang/en/validation.php#L90
By default, a standard Laravel & Inertia setup does share this correctly in my experience, so it's quite likely that you changed something in the default localization setup that's causing this. A good example of this, is that you're using a (different) app locale for which you don't have the correct translations (any longer).
Although I'm fairly certain this isn't a problem caused by Inertia's involvement in your app, it's best to confirm this for yourself by re-creating this situation within a Blade view. If my suspicion is correct, you'd still see the untranslated language key in that situation, even though Inertia isn't being used. Of course, that wouldn't solve your issue, but at the very least it leads you closer to the actual problem, which is all that I can do with the current context/information.
Hope this helps!
Spot on, mate. Thank you so much. I forgot that I (carelessly) deleted the default lang/en folder.
Glad you solved it! 👍
My controller
I followed the documentation for the validation. The error messages are shared to Vue from Laravel but the messages are not shared. Only the index of the error messages are shared I think.
Am I missing something?