jeudi 10 novembre 2016

laravel validation add custom var

I wan't to give user ability to limit upload file size.

    $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',
         ]);

And it throws out error

Method [validate'max] does not exist.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire