Re: upload multi images in laravel

See all posts See thread Reply

Re: upload multi images in laravel new!
by colin, 3 years, 10 months ago
The code you are using is for vanilla PHP uploads. If you are using Laravel, you should do something like:
if($request->hasFile('file')) {
  $files = $request->file('file');
  foreach ($files as $file) {
    $filename = $file->getClientOriginalName();
    $handle = new Upload($filename);
    // ....
  }
}
Reply