2017 © Pedro Peláez
 

library validation

Use Laravel Validation outside of Laravel, This can be useful and helpful for validate any data for our projects.

image

yuliusardian/validation

Use Laravel Validation outside of Laravel, This can be useful and helpful for validate any data for our projects.

  • Saturday, May 12, 2018
  • by yuliusardian
  • Repository
  • 1 Watchers
  • 0 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 767 % Grown

The README.md

YuliusArdian/Validation

This validation package is based on Laravel Validation illuminate/validation, so we can use the Laravel Validation outside of Laravel and using it in our project with freedom., (*1)

Getting started

Requirements

  • PHP >= 5.6.4

Installation

$ composer -v require yuliusardian/validation

Or edit your composer.json and install it., (*2)

  "require": {
    "yuliusardian/validation": "1.0"
  }

```sh $ composer -v install, (*3)


### Basic usage ```php <?php /** * since we installed it via composer, we've to call autoload, this is optional */ require_once 'path/to/composer-vendor/autoload.php'; use YuliusArdian\Validation\Factory; $validator = new Factory; $data = ['name' => 'Hasna Putri Rahmatunissa', 'email' => 'hsnaputri']; $rules = ['name' => 'required|max:10', 'email' => 'required|email']; $validator = $validator->make($data, $rules); $errors = $validator->errors()->all(); var_dump($errors);

From the code above, it will return error :, (*4)

string(47) "The name may not be greater than 10 characters."
string(40) "The email must be a valid email address."

Custom Language

By now, there is only two languages available for this package take a look the src/lang you will see en and id folder. the default language is en. Feel free if you want to contribute. Here's some example of using custom language :, (*5)

<?php
$validator = new Factory('id');

More detail

For more detail about validation like custom message, available method, hooks, etc. Please visit the Laravel Validation Document, (*6)

The Versions

12/05 2018

dev-master

9999999-dev

Use Laravel Validation outside of Laravel, This can be useful and helpful for validate any data for our projects.

  Sources   Download

MIT

The Requires

 

by Yulius Ardian Febrianto

12/05 2018

1.0.0

1.0.0.0

Use Laravel Validation outside of Laravel, This can be useful and helpful for validate any data for our projects.

  Sources   Download

MIT

The Requires

 

by Yulius Ardian Febrianto