Download the PHP package okipa/laravel-request-sanitizer without Composer
On this page you can find all versions of the php package okipa/laravel-request-sanitizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-request-sanitizer
Easily sanitize your request inputs
Sanitize your request inputs with the following features :
- entries sanitizing (https://github.com/Okipa/php-data-sanitizer).
- null entries exclusion.
- values safety check.
Compatibility
Laravel version | PHP version | Package version |
---|---|---|
^5.5 | ^7.1 | ^1.1 |
^5.0 | ^7.0 | ^1.0 |
Table of Contents
- Installation
- Usage
- API
- Properties
- Public methods
- Testing
- Changelog
- Contributing
- Credits
- Licence
Installation
-
Install the package with composer :
- Extends the
Okipa\LaravelRequestSanitizer\RequestSanitizer
in yourapp/Http/Requests/Request.php
class.
Usage
API
Properties
protected $sanitizeEntries = true
Recursively sanitize the request entries.
To check how data will be sanitized, check the used package : https://github.com/Okipa/php-data-sanitizer.
Declare this property to false to disable the request entries sanitizing.protected $exceptFromSanitize = []
Except the declared keys (dot notation accepted) from the request entries sanitizing.
It can be a good option when you have numbers beginning with a zero that you want to keep that way, for example.protected $excludeNullEntries = true
Recursively exclude all the null entries from the request.
Declare this property to false to disable the null entries exclusion.protected $exceptFromNullExclusion = []
Except the declared keys (dot notation accepted) from the null entries exclusion.
protected $safetyChecks = []
Set which request keys (dot notation accepted) should be safety checked, according to their types.
Use case :protected $safetyChecks = ['active' => 'boolean', 'permissions' => 'array'];
.
Accepted types values :boolean
/array
.
The keys declared in this array will take the following values (according to their declared types) if they are not found in the request :- boolean :
false
- array:
[]
- boolean :
Public methods
before()
This package gives you the opportunity to declare this method in your request.
It will be executed before all the request attributes treatments.
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
- Arthur LORENT
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-request-sanitizer with dependencies
illuminate/support Version ~5.5.0||~5.6.0||~5.7.0||~5.8.0||^6.0
okipa/php-data-sanitizer Version ^1.0