rackbeat/laravel-validate-mysql-integers
Validation Rule to ensure a value is within valid Mysql Integer ranges.
Works for signed and unsigned integers of type: TinyInt, SmallInt, Int, BigInt.
Installation
You just require using composer and you're good to go!
composer require rackbeat/laravel-validate-mysql-integers
The Service Provider is automatically registered.
Usage
Class
Rackbeat\Rules\TinyIntegerRackbeat\Rules\SmallIntegerRackbeat\Rules\IntegerRackbeat\Rules\BigInteger
'number' => [
new Rackbeat\Rules\BigInteger($unsigned = true),
],
Helper
The helpers are prefixed with "real_" to prevent overlapping.
It can take an optional parameter to determine if its unsigned. Defaults to false.
real_tiny_intreal_small_intreal_intreal_big_int
'id' => ['real_tiny_int:1'], // unsigned
'number' => ['real_tiny_int:0'], // signed
Requirements
- PHP >= 7.1
Contributors
Related Packages
codezero/laravel-unique-translation
Check if a translated value in a JSON column is unique in the database.
1,123,726
188
illuminatech/validation-composite
Allows uniting several validation rules into a single one for easy re-usage
580,245
180
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 2.1 | >=7.1 | >=5.6 | MIT | |
| 2.0 | >=7.1 | ^5.6| | MIT | |
| 1.8 | >=7.1 | ^5.6| | MIT | |
| 1.7 | >=7.1 | ^5.6| | MIT | |
| 1.6 | >=7.1 | ^5.6| | MIT | |
| 1.5 | >=7.1 | ^5.6| | MIT | |
| 1.4 | >=7.1 | ^5.6| | MIT | |
| 1.3 | >=7.1 | ^5.5| | MIT | |
| 1.2 | >=7.1 | ^5.5| | MIT | |
| 1.1 | >=7.1 | ^5.5| | MIT | |
| 1.0 | >=7.1 | ^5.5| | MIT |