martinsbalodis/validator-laravel

Base validation service class

dev-master 2015-01-30 08:58 UTC

This package is auto-updated.

Last update: 2024-12-11 17:44:57 UTC


README

<?php
namespace App\Lib\Validators;

class MyValidator extends Validator {

	public static $rules = array(
		'title' => 'required',
		'description' => 'required',
	);
}

$input = array(
    'title' => 'asd',
    'description' => 'dsa',
);
$validator = new MyValidator($input);
if(!$validator->fails()) {
    // passes
}
else {
    $validator->messages();
}