定制 tartan/laravel-custom-validator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tartan/laravel-custom-validator

Composer 安装命令:

composer require tartan/laravel-custom-validator

包简介

Laravel 5+ custom validators

README 文档

README

Installation

composer require "tartan/laravel-custom-validator"

Tartan Custom Validators

Add the required validator(s) to boot method of app/Providers/AppServiceProvider.php

Validator::extend('strength', 'Tartan\Validators\CustomValidator@validateStrength');
Validator::extend('iran_billing_id', 'Tartan\Validators\CustomValidator@validateIranBillingId');
Validator::extend('iran_shetab_card', 'Tartan\Validators\CustomValidator@validateShetabCard');
Validator::extend('uuid', 'Tartan\Validators\CustomValidator@validateUuid');
Validator::extend('iran_national_id', 'Tartan\Validators\CustomValidator@validateNationalId');

Add following lines to resources/lang/en/validation.php in Custom Validation Language Lines part

'strength' => 'The password :attribute is too weak and must contain one or more uppercase, lowercase, numeric, and special character (!@#$%^&*).',
'iran_billing_id' => 'The billing Id `:attribute` is not a valid Billing Id.',
'shetab_card' => 'The card number `:attribute` is not a valid Shetab card number.',
'uuid' => 'The UUID `:attribute` is not a valid UUID.',
'iran_national_id' => 'The national id `:attribute` is not a valid Iran nationa Id.',

Use like other validator

	...
	'national_id'    => 'required|iran_national_id|unique:users,national_id',
	'password'       => 'required|string|strength|min:6'
	...

Team

This component is developed by the following person(s) and a bunch of awesome contributors.

Aboozar Ghaffari
Aboozar Ghaffari

Support This Project

Donate via Paypal

License

The Laravel Custom Validator is open-sourced software licensed under the MIT license

统计信息

  • 总下载量: 178
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-05-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固