laravel5.7 使用request自定义的验证规则,验证通过后报错

Symfony Component Debug Exception FatalThrowableError (E_RECOVERABLE_ERROR)
Too few arguments to function AppHttpRequestsArticlePost::IlluminateFoundationProviders{closure}(), 0 passed and exactly 1 expected
https://img4.mukewang.com/5c8cd9a00001866e08490723.jpg

HUX布斯
浏览 1330回答 1
1回答

BIG阳

$validator = Validator::make($request->all(),[            'id' => 'required|integer',         ],[            'id.required'=>'订单id不能为空',            'id.integer'=>'订单id必须整数',         ]);        if ($validator->fails()) {             $errors = $validator->errors()->toArray();             var_dump($errors);         }
打开App,查看更多内容
随时随地看视频慕课网APP