PHP code example of soyhuce / laravel-validation-rules

1. Go to this page and download the library: Download soyhuce/laravel-validation-rules 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/ */

    

soyhuce / laravel-validation-rules example snippets


Validator::make($data, rules([
	'email' => ['0)], // ['nullable', 'string', 'max:20']
	'birthday' => [DbRules::date()], // ['date_format:Y-m-d']
	'tiny' => [DbRules::tinyInteger()], // ['integer', 'min:-128', 'max:127']
	// ...
]));
diff
'commission_account' => Rule::when(
    fn(Fluent $data) => $data->get('commission') !== null,
-   ['