https://github.com/aporat/laravel-filter-var
Laravel package for filtering and sanitizing request variables
https://github.com/aporat/laravel-filter-var
Last synced: 7 months ago
JSON representation
Laravel package for filtering and sanitizing request variables
- Host: GitHub
- URL: https://github.com/aporat/laravel-filter-var
- Owner: aporat
- License: mit
- Created: 2020-08-19T14:24:21.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-11-24T01:46:11.000Z (7 months ago)
- Last Synced: 2024-11-24T02:18:33.112Z (7 months ago)
- Language: PHP
- Homepage:
- Size: 34.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Filter Var
[](https://codecov.io/github/aporat/laravel-filter-var)
[](https://github.styleci.io/repos/288753189?branch=master)
[](https://packagist.org/packages/aporat/laravel-filter-var)
[](https://packagist.org/packages/aporat/laravel-filter-var#dev-develop)
[](https://packagist.org/packages/aporat/laravel-filter-var)Laravel package for filtering and sanitizing request variables
## Installation
The filter-var service provider can be installed via [Composer](https://getcomposer.org/).
```
composer require aporat/laravel-filter-var
```To use the FilterVar service provider, you must register the provider when bootstrapping your application.
## Usage
Filter and escape user agent header:
```php
$user_agent = FilterVar::filterValue('cast:string|trim|strip_tags|escape', $request->header('User-Agent'));
```## License]()
The MIT License (MIT). Please see [License File](LICENSE) for more information.