PHP code example of raoul / php-validator

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

    

raoul / php-validator example snippets




use Raoul\Validator\Validator;

$validator = new Validator();



use Raoul\Validator\Validator;

Class CustomValidator extends Validator
{
    public function rules()
    {
        return [
            // Your rules go here
        ];
    }

    public function messages()
    {
        return [
            // Your custom messages go here
        ];
    }
}

$validator = new CustomValidator();

$validator->validate($data);

$validator->validate($data, [
  'name' => ['

public function rules()
    {
        return [
            'name' => ['
bash
composer