zaynasheff / validation-rules
A collection of reusable validation rules for Laravel applications.
v1.0.0
2026-07-20 11:16 UTC
Requires
- php: ^8.2
- illuminate/contracts: ^10.0|^11.0|^12.0|^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.24
- orchestra/testbench: ^10.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
README
A collection of reusable Laravel validation rules for Russian documents and business identifiers.
Currently supported:
- ✅ Age
- ✅ SNILS
- ✅ INN
Features
- Laravel native validation rules
- Full Laravel localization support
- English and Russian translations
- PHPUnit tested
- PHPStan compatible
- Laravel 13+
- PHP 8.4+
Requirements
- PHP 8.2+
- illuminate/support 10.0+
Installation
composer require zaynasheff/validation-rules
Usage
Age
use Zaynasheff\ValidationRules\Rules\Age; $request->validate([ 'birth_date' => [ 'required', new Age(min: 18), ], ]);
Between:
new Age(min: 18, max: 65)
SNILS
use Zaynasheff\ValidationRules\Rules\Snils; $request->validate([ 'snils' => [ 'required', new Snils(), ], ]);
Accepted formats:
11223344595
112-233-445 95
INN
use Zaynasheff\ValidationRules\Rules\Inn; $request->validate([ 'inn' => [ 'required', new Inn(), ], ]);
Supports:
- Individual INN (12 digits)
- Legal entity INN (10 digits)
Localization
Package includes translations for:
- English
- Russian
Laravel localization works automatically.
Testing
composer test
Run static analysis:
composer analyse
Run formatter:
composer format
Run all checks:
composer fix
Contributing
Pull requests are welcome.
Please ensure that all tests and static analysis pass before submitting changes.
License
The MIT License (MIT).