ozziest/windrider

Usefull form validation library

3.0.0 2017-10-11 17:56 UTC

This package is not auto-updated.

Last update: 2024-11-09 19:04:41 UTC


README

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

Windrider is a simple and useful validation library which you can use it on your projects.

Installation

$ composer require ozziest/windrider

#### Usage

try
{
    $data = ['name' => ''];
    $rules = [
        ['name', 'Name', 'required'],
        ['email', 'E-Mail', 'required|valid_email']
    ];
    Ozziest\Windrider\Windrider::runOrFail($data, $rules);
}
catch (Exception $exception)
{
    var_dump(Ozziest\Windrider\Windrider::getErrors());
}

Methods

  • run($data, $rules)
  • runOrFail($data, $rules)
  • getErrors()
  • setErrors($messages)

#### Validations

  • required
  • valid_email
  • min_length[n]
  • max_length[n]
  • exact_length[n]
  • alpha
  • alpha_numeric
  • alpha_dash
  • alpha_local (Turkish characters support)
  • sentence (Turkish characters support)
  • numeric
  • integer
  • is_natural
  • is_natural_no_zero
  • less_than[n]
  • greater_than[n]

Exception

ValidationException

License

MIT