Model validation with all the fields together #1199
-
So I have various repeatable fields and I need to do some calculation to check if some value from a field and from another based on some math are ok or not and show an alert. I saw https://laravel.com/docs/11.x/validation#performing-additional-validation-on-form-requests and also how to access all the data but is not clear how to do it in backpack on the model saving. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello @Mte90, It sounds like you’re looking to implement custom validation for your repeatable fields, which is definitely achievable! Have you had a chance to try out the custom validation approach? Cheers! |
Beta Was this translation helpful? Give feedback.
-
I was able to find the solution with chatgpt because on google I wasn't very lucky. So in your StoreRequest a code like this is executed on saving of the CRUD so it is possible to access all the data and do what you need:
|
Beta Was this translation helpful? Give feedback.
I was able to find the solution with chatgpt because on google I wasn't very lucky.
So in your StoreRequest a code like this is executed on saving of the CRUD so it is possible to access all the data and do what you need: