Join 25,000+ Laravel Developers and join the free Laravel Newsletter
Laravel / July 10, 2014

Laravel inspired – validatorjs

A JavaScript validator for both node and the client. Inspired by the Laravel PHP framework’s Validator class.

Example Usage:

var data = {
    name: 'David',
    email: '',
    age: 28

var rules = {
    name: 'required',
    email: 'required|email',
    age: 'min:18'

var validation = new Validator(data, rules);

validation.passes(); // true
validation.fails(); // false

This appeared first on Laravel News

Visit Resource →

Laravel News Partners


Join the weekly newsletter and never miss out on new tips, tutorials, and more.