PHP code example of dartui / polish-validators

1. Go to this page and download the library: Download dartui/polish-validators library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dartui / polish-validators example snippets


Dartui\PolishValidators\ServiceProvider::class

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

$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();