decoy icon indicating copy to clipboard operation
decoy copied to clipboard

Failed Validation rules not showing on validation object passed to onValidation/Validating

Open toddvalentine opened this issue 8 years ago • 1 comments

If a Photo model that extends from the Decoy Base model and uses HasImages fails dimension validation, I would like to prevent the model from being created.

I have tried to extend the onValidating and onValidation methods and conditionally check for failed/fails on the Illuminate\Validation\Validator object passed as the argument to these methods, but I am not seeing any failed rules.

Should the failed dimensions rules be available via failed in this instance?

toddvalentine avatar Jun 29 '17 19:06 toddvalentine

looks like by the time we fail validation model is set to Image, so onValidating on my Photo model is never called. Can't seem to find a way to go back once Image has failed validation and delete the related model.

toddvalentine avatar Jun 29 '17 20:06 toddvalentine