An open API service indexing awesome lists of open source software.

https://github.com/david-kurniawan/validvid

PHP Laravel standalone validation library
https://github.com/david-kurniawan/validvid

laravel php php-library php-standalone-library validation

Last synced: about 1 year ago
JSON representation

PHP Laravel standalone validation library

Awesome Lists containing this project

README

          

# Laravel Validation Standalone Library

[![Build Status](https://img.shields.io/travis/David-Kurniawan/validvid.svg?style=flat-square)](https://travis-ci.org/David-Kurniawan/validvid)
[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://doge.mit-license.org)

## Requirements
* PHP 7.1 or higher
* Composer for installation

## Installation

```sh
$ composer require david-kurniawan/validvid
```

## Usage

```php
use Validvid\Validation\Validator;

$data['email'] = 'foobar@gmail.com';
$rules = ['email' => 'required|email|not_in:foobar@gmail.com'];
$errors = null;

$validator = (new Validator())->make($data, $rules);
if ($validator->fails()) {
$errors = $validator->errors();
}

return $errors;
```

More usage: [Laravel Validation](https://laravel.com/docs/6.x/validation)