验证器错误返回

use Illuminate\Contracts\Validation\Validator;

public function failedValidation(Validator $validator)
    {
        $error_msg = $validator->errors()->first();
        return $this->fail(100002,$error_msg);
    }

 

posted @ 2021-09-22 16:03  CanyingV  阅读(32)  评论(0编辑  收藏  举报