Getting null while uploading multiple images in Laravel

  file-upload, laravel

I am getting null while I tried to upload multiple images in Laravel 8.

 In Blade:

<form method="POST" action="{{ url('admin/add_images/'.$album_id.'/save') }}" enctype="multipart/form-data">

 <input name="image_name[]" type="file" accept="image/*" multiple>

In Controller

 function save_image(Request $req, $id)
  {
     $gallery =  new GalleryImage();  
    return $req->file('image_name') ;
  }

I browse 2 images and upload.

I got this output

Source: Laravel

Leave a Reply