Download the PHP package arifszn/laravel-advanced-validation without Composer
On this page you can find all versions of the php package arifszn/laravel-advanced-validation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download arifszn/laravel-advanced-validation
More information about arifszn/laravel-advanced-validation
Files in arifszn/laravel-advanced-validation
Package laravel-advanced-validation
Short Description Laravel advanced validation rules for real-life scenarios.
License MIT
Informations about the package laravel-advanced-validation
Laravel Advanced Validation
Laravel advanced validation rules for real-life scenarios.
Installation
Install via composer
Laravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
Translations
If you wish to edit the package translations, you can run the following command to publish them into your resources/lang
folder
Custom Error Message
You can specify the error message on the fly when declaring the rules. Simple pass the error message parameter.
Available Validation Rules
Ascii
Base64 Image
Base64 String
BIC
Btc Address
Credit Card
Data URI
Divisible By
Ethereum Address
Float Number
Hash
Image URL
JWT
Name
Phone
Username
Without Spaces
Ascii
The field under validation must contain ASCII chars only.
Base64Image
The field under validation must be a Base64 encoded image.
Base64String
The field under validation must be a Base64 encoded string.
BIC
The field under validation must be a BIC(Business Identifier Code) or SWIFT code.
BtcAddress
The field under validation must be a valid BTC address.
CreditCard
The field under validation must be a valid credit card number.
DataURI
The field under validation must have data uri format.
DivisibleBy
The field under validation must be divisible by the given number.
EthereumAddress
The field under validation must be an Ethereum address. Does not validate address checksums.
FloatNumber
The field under validation must be a float number.
Hash
The field under validation must be a hash of type algorithm.
Algorithm is one of 'md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b'
.
ImageURL
The field under validation must be a valid image URL.
✓ https://www.php.net/images/logos/php-logo.png \ ✕ https://imaginarysite123.com/invalid.png
JWT
The field under validation must have a valid format of JWT (JSON Web Token).
Name
The field under validation must be a valid name.
- no emoji
- no number (if
$allowNumber
flag is true, it will accept numbers, default is false) - special characters are allowed (restricting special characters will cause false-negative for names like
Martin Luther King, Jr.
or李小龍
)
Phone
The field under validation must be a valid phone number.
✓ +x-xxx-xxx-xxxx \ ✓ +xxxxxxxxxxx \ ✓ (xxx) xxx-xxxx \ ✓ xxxxxxxxxx
Username
The field under validation must be a valid username.
- starts with a letter (alpha)
- only alpha-numeric (a-z, A-Z, 0-9), underscore, minus and dot
- multiple underscores, minus and are not allowed (-- or __ or ..)
- underscores, minus and dot are not allowed at the beginning or end
WithoutSpaces
The field under validation must not contain spaces.
Tips
If you want to use the rules as strings and use them globally e.g. 'foo' => ['phone']
, you can do so by adding them to the boot method of your project's AppServiceProvider.
Testing
Contributing
Any contributors who want to make this project better can make contributions, which will be greatly appreciated. To contribute, clone this repo locally and commit your code to a new branch. Feel free to create an issue or make a pull request.
Credits
Support
License
This package is licensed under the MIT License.