tylercd100/laravel-validator-state
Composer 安装命令:
composer require tylercd100/laravel-validator-state
包简介
Validate that a states and provinces for US and Canada
README 文档
README
This Package has moved to here for laravel 5.5+. Please use that instead. Also check out these other community validation rules
Installation
Install via composer - In the terminal:
composer require tylercd100/laravel-validator-state
Now add the following to the providers array in your config/app.php
Tylercd100\Validator\State\ServiceProvider::class
Usage
# USA vs Canada Validator::make(['test' => 'UT'], ['test' => 'state']); //true Validator::make(['test' => 'UT'], ['test' => 'state:usa']); //true Validator::make(['test' => 'BC'], ['test' => 'state:canada']); //true # Abbreviation vs Full Validator::make(['test' => 'Utah'], ['test' => 'state:full']); //true Validator::make(['test' => 'UT'], ['test' => 'state:abbr']); //true # Mix and match Validator::make(['test' => 'UT'], ['test' => 'state:usa,abbr']); //true Validator::make(['test' => 'Alberta'], ['test' => 'state:canada,full']); //true
统计信息
- 总下载量: 44
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-04-13