Waavi / Sanitizer

Data sanitizer and form request input sanitation for Laravel 5.
MIT License
429 stars 87 forks source link

filter_if: Option? #38

Open inpariswithyou opened 5 years ago

inpariswithyou commented 5 years ago

Laravel validation has a required_if:field,value... Is there any option like that for the filters?

(The use case here has to do with postal codes. I want to run a custom ZIP validator I wrote only if the country = 'USA', but I can't think of a way to do this.

If there is no option for something like this, is there a way to pass another field to a custom filter? Then I could pass the country and just do an if there...

toksdotdev commented 5 years ago

It would be of great help if this could be possible.