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