You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
This seems like a feature request or an improvement so I'm moving this to the ideas repository instead. It's best to post these in the ideas repository in the future to get support for your idea. After that you may send a PR to the framework. Please only use the laravel/framework issue tracker to report bugs and issues with the framework.
@vpratfr we don't really monitor issues in this repo. This repo is meant as a discussion place for community members. If you want to propose something it's better to send in a PR so we can look at actual code.
Description:
In a complex form, we need to build some validation rules for an array which should get triggered only on some complex logic based on each item data.
The way array validation is defined is usually something like that
However, as seen above, the closure to determine when to trigger those rules is global to the form data, not to the item's data.
Hence we dynamically add rules for each item in the form like that:
We have to do that because there is no way I know of to define a sometimes rule which will look into the corresponding item's data only.
All that works nicely. One issue we have is with the translation for the validation messages. We have in the
validation.php
file:That does not get picked up. The message shown is still « The field items.12.level is required » instead of « The field Niveau is required ».
The text was updated successfully, but these errors were encountered: