Download the PHP package peeyush-budhia/sanitizer without Composer
On this page you can find all versions of the php package peeyush-budhia/sanitizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download peeyush-budhia/sanitizer
More information about peeyush-budhia/sanitizer
Files in peeyush-budhia/sanitizer
Download peeyush-budhia/sanitizer
More information about peeyush-budhia/sanitizer
Files in peeyush-budhia/sanitizer
Vendor peeyush-budhia
Package sanitizer
Short Description Sanitization library for PHP and the Laravel framework.
License MIT
Homepage https://github.com/peeyush-budhia/sanitizer
Package sanitizer
Short Description Sanitization library for PHP and the Laravel framework.
License MIT
Homepage https://github.com/peeyush-budhia/sanitizer
Please rate this library. Is it a good library?
Informations about the package sanitizer
Laravel Sanitizer
Sanitization library for PHP and the Laravel framework.
Installation
You can install the package via composer:
Core PHP Usage
Will return:
Laravel Usage
-
Register the
provider
and update thealias
of Sanitizer inconfig/app.php
as under: - Now Publish
request.stub
andtests
directory. To publish, run the following command on terminal, in the document root of the application:
After the above process you can use Sanitizer as follows
-
Use the Sanitizer through the Facade:
-
Use SanitizeInput trait to Sanitize input in your FormRequests. Please note you need to add filters method which returns the filters you want to apply to the input.
- To auto generate the Request file run the following command on terminal, in the document root of the application:
Available Filters
Filter | Description |
---|---|
trim |
Trims a string |
escape |
Escapes HTML and other special characters |
lowercase |
Converts a string to lowercase |
uppercase |
Converts a string to UPPERCASE |
capitalize |
Converts a string to Title Case |
cast |
Casts a variable into the given type. Options are: int , float , string , bool , object , array and Laravel Collection collection |
format_date |
Converts the date format. It takes two arguments, first date's given format second date's target format |
strip_tags |
Strip HTML and PHP tags |
digit |
Get only digit characters from a string |
Custom Filters
- Use Closure or Class that implements
Peeyush\Sanitizer\Contracts\Filter
interface:
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of sanitizer with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.0
illuminate/support Version ^9.0|^10.0
illuminate/validation Version ^9.0|^10.0
nesbot/carbon Version ^1.0|^2.0
illuminate/support Version ^9.0|^10.0
illuminate/validation Version ^9.0|^10.0
nesbot/carbon Version ^1.0|^2.0
The package peeyush-budhia/sanitizer contains the following files
Loading the files please wait ....