PHP code example of saritasa / laravel-fluent-validation

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

    

saritasa / laravel-fluent-validation example snippets


$rules = [
    'id' => Rule::int()->red()->minLength(3)->toString(),
    'email' => Rule::string()-> 
                             function($ruleWhenTrue) { 
                                 return $ruleWhenTrue->min(1000000); 
                             }, 
                             function($ruleWhenFalse) { 
                                 return $ruleWhenFalse->max(1000); 
                             }
    )
]

$rules = [
    ... => Rule::custom('foo')
]

'providers' => array(
    // ...
    Saritasa\Laravel\Validation\FluentValidationServiceProvider::class,
)
 vendor/bin/phpcs
 vendor/bin/phpcbf
 vendor/bin/phpunit