mercredi 10 mai 2017

Call to a member function hashName() on array Laravel 5.4

I'm trying to upload multiple images in same input and same row in the database same way worked with me with the single image upload but I got errors when I try it with Multiple images

here's my code :
Controller

$files = $request->file('file');
if(!empty($files)) :
    foreach($files as $file) :
      $name = time().$file->getClientOriginalName();
      Storage::putfile('public/images', $request->file('file'));
      $file->move('images/client/preview', $name);
      $car->file = $name;
    endforeach;
endif;

HTML

 <div class="form-group  ">
  <input class="form-control" type="file" id="files" name="file[]" value="" multiple />
  <output id="list"></output>
  @if($errors->has('file'))
  <div class="alert alert-danger alert-dismissable">
    <i class="fa fa-info"></i>
    <b>Alert!</b> 
  </div>
  @endif
</div>


Here's The error :

I got this error



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire