Lomkit / laravel-rest-api

Generate Api in seconds
https://laravel-rest-api.lomkit.com/
MIT License
297 stars 18 forks source link

Translate attributes validation rules #110

Open Samoht70 opened 3 months ago

Samoht70 commented 3 months ago

Description

I use laravel's translation layer. I've been able to translate quite a few texts without any problem, except for the attributes for the rules. Laravel lets you translate these attributes in the validations.php language file by creating an attributes array. Except that for Lomkit validation errors, the attributes are formed like this: mutate.*.email with * the object index in the request body. It's very difficult to know at which index the error on our attribute is located in the validations.php file.

GautierDele commented 3 months ago

This is related to Laravel validation feature, might need to do a change request on Laravel