zaynasheff/validation-rules

A collection of reusable validation rules for Laravel applications.

Maintainers

Package info

github.com/zaynasheff/validation-rules

pkg:composer/zaynasheff/validation-rules

Transparency log

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-07-20 11:16 UTC

This package is auto-updated.

Last update: 2026-07-20 11:30:39 UTC


README

Latest Version on Packagist PHP Version License

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).