dartui/polish-validators

Polish Validators for Laravel
1,574 4
Install
composer require dartui/polish-validators
Latest Version:1.0.1
PHP:>=5.6.4
License:MIT
Last Updated:Jul 14, 2017
Links: GitHub  ·  Packagist
Maintainer: Dartui

Laravel Polish Validators

Available rules

Name Description Example Field or Parameter
PESEL Universal Electronic System for Registration of the Population 73021604589 pesel
NIP VAT identification number (without leading PL) 123-123-12-12 nip
REGON Taxpayer Identification Number 158395862 regon
PWZ Doctors license number 6249056 pwz

Instalation

Require this package with composer:

composer require dartui/polish-validators

After updating composer, add the ServiceProvider to the providers array in config/app.php

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider

Dartui\PolishValidators\ServiceProvider::class

Now you need to add message to language files in resources/lang/XX/validation.php

'valid' => 'The :attribute is not valid.',

Usage

By default validation type is chosen by field name. If you want you can force validation type by giving parameter after colon in rule.

$data = [
	'pesel'         => '01234567890',
	'some_field'    => '123123123',
	'another_field' => '12345678',
	'pwz'           => '1311111',
];

$validator = Validator::make( $data, [
	'pesel'         => 'valid',
	'some_field'    => 'valid:nip',
	'another_field' => 'valid:regon',
	'pwz'           => 'valid',
] );

$validator->valid();

Related Packages

rap2hpoutre/laravel-credit-card-validator

Laravel credit card validator

132,269 21
tylercd100/laravel-validator-phone

Validate that a phone number is in the correct format

4,377 3
tylercd100/laravel-validator-color

Validate that a certain value is a valid CSS color string in Laravel 5

81,275 15
ellisio/laravel-phone

A phone validator for Laravel using the free Twilio phone lookup service.

29,983 11
proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rul...

2,407,050 1,142