gcoderre / laravel-canpost-validator by gcoderre

Canadian postal code validator for Laravel 4x
32
1
2
Package Data
Maintainer Username: gcoderre
Maintainer Contact: guillaume@molotov.ca (Guillaume Coderre)
Package Create Date: 2013-11-12
Package Last Update: 2014-08-02
Home Page:
Language: PHP
License: Unknown
Last Refreshed: 2024-11-19 03:06:58
Package Statistics
Total Downloads: 32
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 3
Total Open Issues: 0

Canadian postal code validator for Laravel 4.x

Just what it says.

Usage

  1. Install with composer
{
  "require": {
    "molotov/laravel-canpost-validator": "1.0.*"
  }
}
  1. Add the service provider to your project's autoloader in /app/config/app.php
'providers' => array(
  // ...
  'Molotov\CanpostValidator\CanpostValidatorServiceProvider'
);
  1. 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);