<?php
namespace App\Validators;

/**
 * 合作商 验证器
 */
class CollaboratorValidator extends BaseValidator {
    //验证规则
    protected $rule =[
        'avatar' =>'required',
        'name' =>'required|name',
        'mobile' =>'required|mobile',
        'intro' =>'required',
//        'specialty' =>'required',
        'bio' =>'required',
//        'protocols' =>'required',
        'status' =>'required|in:1,2',
        'reason' =>'required_if:status,2',
    ];
    //自定义验证信息
    protected $message = [
        'avatar.required' =>'请上传头像',
        'name.required' =>'请填写姓名',
        'name.name' =>'请规范填写姓名',
        'mobile.required' =>'请填写手机号',
        'mobile.mobile' =>'手机号格式错误',
        'intro.required' =>'请填写个人简介',
//        'specialty.required' =>'请填写特长',
        'bio.required' =>'请上传简历',
//        'protocols.required' =>'请上传合作协议',
        'status.required' =>'缺少对应的审核操作',
        'status.in' =>'审核操作类型错误',
        'reason.required_if' =>'请填写拒绝原因',

    ];

    //自定义场景
    protected $scene = [
        'store' => ['avatar','name','mobile','intro','specialty','bio','protocols'],
        'audit' => ['status','reason'],
    ];
}
