0
我不想給用戶限制上傳文件大小的能力。laravel驗證添加自定義變量
$uploadSize = Settings::where('id','=','1')->first();
$upSz=$uploadSize->uploadSize;
$upMz="'max:".$upSz."'";
$this->validate($request, [
'file' => $upMz,
'file' => 'mimes:doc,docx,xslx,ppt,pptx,zip,rar,pdf',
]);
它拋出錯誤
Method [validate'max] does not exist.