PHP code example of ramonbakker1992 / validation-rules-helper

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

    

ramonbakker1992 / validation-rules-helper example snippets


class ProjectValidation extends ValidationRules
{
    protected function validation()
    {
        return [
            'name' => 'string|max:100',
            'number' => 'numeric|between:1000,9999',
            'start_date' => 'date',
            'end_date' => 'date|after_or_equal:start_date',
        ];
    }
}

$rules = ProjectValidation::rules()
    ->