Laravel 10, mistake with new translation model for api
After update a app to laravel 10, I see changes on messages of validation diferents for API calls.
Wit docs in my hands...
Publishing The Language Files
By default, the Laravel application skeleton does not include the lang directory. If you would like to customize Laravel's language files or create your own, you should scaffold the lang directory via the lang:publish Artisan command. The lang:publish command will create the lang directory in your application and publish the default set of language files used by Laravel:
php artisan lang:publish
Well, after this and after verify that lang/en is create, adn edit en/validation.php for make a simple test
'unique' => 'JOJOJO The :attribute has already been taken.',
And test calling api with postman, get a original message
{
"message": "The name has already been taken. (and 2 more errors)",
"errors": {
"name": [
"The name has already been taken."
],
"imei": [
"The imei has already been taken."
],
"ip": [
"The ip has already been taken."
]
}
}
But if try to edit vendor/laravel/framework/src/Illuminate/Translation/lang/en/validation.php works fine
{
"message": "JOJOJO The name has already been taken. (and 2 more errors)",
"errors": {
"name": [
"JOJOJO The name has already been taken."
],
"imei": [
"JOJOJO The imei has already been taken."
],
"ip": [
"JOJOJO The ip has already been taken."
]
}
}
I think this is a possible bug or mistake because I've upgraded this app from Laravel 9.0 (and after from 8.0)
Please or to participate in this conversation.