dartui / polish-validators
Polish Validators for Laravel
Installs: 1 570
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 1
Requires
- php: >=5.6.4
- illuminate/support: 5.1.*|5.2.*|5.3.*|5.4.*|5.5.*
This package is auto-updated.
Last update: 2024-11-05 18:51:57 UTC
README
Available rules
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();