molotov/laravel-canpost-validator

Canadian postal code validator for Laravel 4x

Installs: 7

Dependents: 0

Stars: 1

Watchers: 1

Forks: 2

Language: PHP

v1.0.0 2013-11-12 16:08 UTC

README

Just what it says.

Usage

1) Install with composer

{
  "require": {
    "molotov/laravel-canpost-validator": "1.0.*"
  }
}

2) Add the service provider to your project's autoloader in /app/config/app.php

'providers' => array(
  // ...
  'Molotov\CanpostValidator\CanpostValidatorServiceProvider'
);

3) Use it by adding canadian_postal_code to your attribute's validation rules.

$rules = array('postal_code' => 'canadian_postal_code|required');
Validator::make($attributes, $rules);