LaravelPackages.net
Acme Inc.
Toggle sidebar
rackbeat/laravel-validate-mysql-integers

Validation Rule to ensure a value is within valid Mysql Integer ranges.

40.824
5
2.0
About rackbeat/laravel-validate-mysql-integers

rackbeat/laravel-validate-mysql-integers is a Laravel package for validation rule to ensure a value is within valid mysql integer ranges.. It currently has 5 GitHub stars and 40.824 downloads on Packagist (latest version 2.0). Install it with composer require rackbeat/laravel-validate-mysql-integers. Discover more Laravel packages by rackbeat or browse all Laravel packages to compare alternatives.

Last updated

Validation Rule to ensure a value is within valid Mysql Integer ranges.

Works for signed and unsigned integers of type: TinyInt, SmallInt, Int, BigInt.

Build Status Coverage Total Downloads Latest Stable Version License

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\TinyInteger
  • Rackbeat\Rules\SmallInteger
  • Rackbeat\Rules\Integer
  • Rackbeat\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_int
  • real_small_int
  • real_int
  • real_big_int
'id'        => ['real_tiny_int:1'], // unsigned
'number'    => ['real_tiny_int:0'], // signed

Requirements

  • PHP >= 7.1

Contributors

Star History Chart