{"repo":"arondeparon/laravel-request-sanitizer","free":true,"listed":false,"github":"https://github.com/arondeparon/laravel-request-sanitizer","clone":"git clone https://github.com/arondeparon/laravel-request-sanitizer.git","description":"An easy to use request sanitizer that allows you to sanitize your form data before validating it.","language":"PHP","stars":112,"topics":["laravel","php","request","sanitizer","hacktoberfest"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Laravel Request Sanitizer [![Total Downloads][ico-downloads]][link-downloads] The arondeparon/laravel-request-sanitizer package provides a fluent interface to sanitize form requests before validating them. Why should I use this package? Often, validating your request is not enough. The request sanitizer allows you to easily manipulate your form data before passing it to the validator. You can start using it in a matter of minutes and it is fully compatible with Laravel's FormRequest object. Table of Contents How to use Installing Usage + Basic Usage + Using Wildcards Predefined Sanitizers + FilterVars usage Writing your own Sanitizer Testing Credits License How to use Syntax is similar to the way rules are added to a Form Request. Installing composer require arondeparon/laravel-request-sanitizer Usage Basic Usage - Add the SanitizesInputs trait to your form request. - Write your own sanitizers or use one of the supplied sanitizers and add them to the $sanitizers property of your form request. - Your request data will now be sanitized before being validated. Using Wildcards The sanitizer supports wildcard patterns in your form keys, allowing you to apply sanitizers to multiple fields that match a pattern. This is particularly useful when dealing with arrays or nested data structures. Example input: After sanitization: The wildcard pattern ( ) will match any single segment in the dot notation path. You can use multiple wildcards to match nested structures at any depth. Predefin","default_branch":null,"files":null,"tree":[],"storefront":"/r/arondeparon","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/arondeparon/laravel-request-sanitizer/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}