<?php
namespace App\Validators;

/**
 * 银行卡验证器
 */
class AccountsValidator extends BaseValidator {
    //验证规则
    protected $rule =[
        'name'=>'required|name',
        'bank_of_deposit'=>'required',
        'bank_no'=>'required',
//        'mobile'=>'required',
        'type'=>'required',
    ];
    //自定义验证信息
    protected $message = [
        'name.required'=>'请填写姓名',
        'name.name'=>'姓名格式错误',
        'bank_of_deposit.required'=>'请填写开户行',
        'bank_no.required'=>'请填写银行卡号',
        'type.required'=>'请选择账户类型',
    ];

    //自定义场景
    protected $scene = [
        'add'=>['bank_of_deposit','name','bank_no','mobile','type'],
        'update'=>['bank_of_deposit','name','bank_no','mobile','type'],
    ];
}
