A set of useful Laravel validation rules for identifiers of Russian individuals and legal entities
anper/russian-id-laravel is a Laravel package for a set of useful laravel validation rules for identifiers of russian individuals and legal entities.
It currently has 1 GitHub stars and 468 downloads on Packagist (latest version v0.4.0).
Install it with composer require anper/russian-id-laravel.
Discover more Laravel packages by anper
or browse all Laravel packages to compare alternatives.
Last updated
A set of useful Laravel validation rules for identifiers of Russian individuals and legal entities.
$ composer require anper/russian-id-laravel
The package will automatically register itself.
If you wish to edit the package translations, you can run the following command to publish them into your resources/lang folder
$ php artisan vendor:publish --provider="Anper\RussianId\Laravel\RussianIdServiceProvider"
The KsRule and RsRule require the BIK attribute in the validated data. You must provide the attribute name in them constructors.
<?php
use Anper\RussianId\Laravel\Rules\BikRule;
use Anper\RussianId\Laravel\Rules\KsRule;
use Anper\RussianId\Laravel\Rules\RsRule;
use Illuminate\Support\Facades\Validator;
$validator = Validator::make([
'bik_field'=> '...',
'ks_field' => '...',
'rs_field' => '...',
], [
'bik_field'=> new BikRule(),
'ks_field' => new KsRule('bik_field'),
'rs_field' => new RsRule('bik_field'),
]);
The package is tested with PHPUnit. To run tests:
$ composer test
The code is statically analyzed with PHPStan. To run static analysis:
$ composer stan
The MIT License (MIT). Please see License File for more information.