Best way to use validation messages from package?
I'm working on a Laravel app where the main content of the site is delivered via a package. I'm using this (https://github.com/Propaganistas/Laravel-Phone) library to do phone number validation. It does not provide a default message for failed validation, and instead Laravel looks for a message in the localization files to match the validation.phone key.
In my package, I've created a validation.php file and added the message with the appropriate key. I then call $this->loadTranslationsFrom(...) in the service provider for my package, which loads it into the namespace for my package.
Finally, I'm required to then manually pass the message to the validator using 'phone.phone' => trans('myNamespace::validation.phone'), in the messages array.
This is all a bit cumbersome given that all of the content for the site is in a package, and I'm wondering if there is any way to load localization messages into the default namespace so that validation messages can be discovered automatically. Thank you in advance for any insight into this issue.
Please or to participate in this conversation.