PHP code example of juststeveking / fluent-validation

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

    

juststeveking / fluent-validation example snippets


return [
    'email' => \JustSteveKing\FluentValidation\Fluency\EmailRule::rules()
];

return [
    'email' => [
        \JustSteveKing\FluentValidation\Rules\Required::rule(),
        \JustSteveKing\FluentValidation\Rules\Email::rule('rfc,dns'),
    ]
];

return [
    'password' => \JustSteveKing\FluentValidation\Fluency\PasswordRule::rules()
];

return [
    'password' => [
        \JustSteveKing\FluentValidation\Rules\Required::rule(),
        \Illuminate\Validation\Rules\Password::default(),
    ]
];

return [
    'title' => \JustSteveKing\FluentValidation\Fluency\StringRule::rules()
];

return [
    'title' => [
        \JustSteveKing\FluentValidation\Rules\Required::rule(),
        \JustSteveKing\FluentValidation\Rules\Text::rule(),
        \JustSteveKing\FluentValidation\Rules\Min::rule(2),
        \JustSteveKing\FluentValidation\Rules\Max::rule(255),
    ]
];