Answers for "laravel image upload validation"

PHP
6

laravel image validation

'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
Posted by: Guest on May-30-2020
1

image validate in laravel validater

$this->validate($request, ['file' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',]);
Posted by: Guest on October-20-2020
1

laravel validation image or file

$validate = Validator::make($params = $request->all(), [
  'type' => 'required',
  'files' => 'mimes:jpeg,png,jpg,svg,doc,docx,odt,pdf,tex,txt,wpd,tiff,tif,csv,psd,key,odp,pps,ppt,pptx,ods,xls,xlsm,xlsx'
]);
Posted by: Guest on May-11-2021
0

laravel upload image document validator

$document = $request->upload_file;
if ($document) {
  $validate = Validator::make(
    [
      'extension' => strtolower($request->upload_file->getClientOriginalExtension()),
    ],
    [
      'extension' => 'in:jpg,jpeg,png,gif,pdf,csv,docx,xlsx,txt',
    ]
  );
  if ($validate->fails())
    return redirect()->back()->withErrors($validator->errors());

  $fileName = $document->getClientOriginalName();
  $document->move('public/documents', $fileName);
  $data['upload_file'] = $fileName;
}
Posted by: Guest on June-24-2021

Code answers related to "laravel image upload validation"

Browse Popular Code Answers by Language