martinsbalodis/validator-laravel

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Base validation service class

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

This package is auto-updated.

Last update: 2021-11-11 11:03:32 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();
}