帮助请。“如何在 laravel 中添加错误用户错误”我想显示 JSON 文件 - 错误 $regex - 我需要的规则规则在不正确的 sourceUrl 上出现错误
$this->validate($request,[
'title' => 'required|min:10|max:250', //work
'subTitle' =>'sometimes|present|nullable|min:10|max:250', //work
'message' => 'required|min:10',//work
'recommendPic' => 'present|nullable', //work
'pic' => 'required|sometimes', //file - check upload file,image need fix
'sourceUrl' =>'required|regex:'.$regex,
],[
'sourceUrl.regex:'.$regex=>'mistake',
]);