I need to filter / sanitize user input during validation.
I have request data which needs to be filtered/sanitized (html input with only a few html tags allowed) during validation.
As far as I understand custom validation rules, you only can reject or pass an value for an attribute. But I want to filter / sanitize (for example with HtmlPurifier) a value and passing the filtered value to the next validation rule.
Is this possible or do I have to do that for my request data before passing it to the Validator?
Well, you either let it pass validation and then sanitise it (I'm not recommending this way), or, you sanitise it so that it can pass validation. It is up to you.
I would do it on the Form Request, and then pass it through the validation. That way you know that it should pass.
Yeah I definitely would want to sanitize before validation. Just was not sure if the Validator could also do filtering (CodeIgniter for example is doing that).