标签:response 错误信息 user class required fir color 请求 err
public function login(Request $request) { $info = Validator::make($request->all(), [ ‘username‘ => ‘required‘, ‘password‘ => ‘required‘, ],[ ‘username.required‘ => ‘用户名必须填写‘, ‘password.required‘ => ‘密码必须填写‘, ]); if ($info->fails()) { //返回json数据 return response()->json([‘code‘=>"201","msg"=>$info->errors()->first()]); } // dd($info->errors()->first()); // return $info; }
标签:response 错误信息 user class required fir color 请求 err
原文地址:https://www.cnblogs.com/zjj1990/p/11721170.html