molotov/laravel-canpost-validator

此包最新版本(v1.0.0)没有提供许可证信息。

Laravel 4x 的加拿大邮政编码验证器

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

This package is not auto-updated.

Last update: 2024-09-24 05:10:49 UTC


README

正如其名。

用法

  1. 使用composer安装
{
  "require": {
    "molotov/laravel-canpost-validator": "1.0.*"
  }
}
  1. 将服务提供者添加到项目自动加载器中的 /app/config/app.php
'providers' => array(
  // ...
  'Molotov\CanpostValidator\CanpostValidatorServiceProvider'
);
  1. 通过将 canadian_postal_code 添加到属性的验证规则中来使用它。
$rules = array('postal_code' => 'canadian_postal_code|required');
Validator::make($attributes, $rules);