title: I am trying to update multiple images but getting error using laravel 8
body: <p>I am trying to update multiple images but unfortunately I am getting error please help me how can i resolved that ? thank u.</p>
  <p><strong>please check error</strong></p>
  <p>Invalid argument supplied for foreach()</p>
  <p><strong>controller</strong></p>
  <pre><code>       public function update(Request $request, $roomId)
           {
       
              if($request-&gt;has('images')){
                  foreach($request-&gt;file('images')  as $value){
                      $extension = $value-&gt;getClientOriginalExtension();
                       Storage::disk('wfh')-&gt;put($value-&gt;getFilename() . '.' . $extension, 
                       File::get($value));
  
                       $roomDetail-&gt;image = $value-&gt;getFilename() . '.' . $extension;
  
                       $roomDetail = RoomDetail::where('room_id',$roomId)-&gt;first();
  
                      $roomDetail-&gt;update([
                          'room_id'  =&gt; $roomId,
                          'image' =&gt;   $roomDetail-&gt;image,
                      ]);
  
                  }
  
          }
  </code></pre>
  <p><strong>Html view</strong></p>
  <pre><code>      &lt;form action=&quot;{{route('room.update',$editRooms-&gt;id)}}&quot; method=&quot;POST&quot; class=&quot;needs-validation&quot; 
        novalidate  enctype=&quot;multipart/form-data&quot;&gt;
          @csrf
          @method('PUT')
          &lt;div class=&quot;row&quot;&gt;   
              &lt;div class=&quot;col-md-8&quot;&gt;
                  &lt;div class=&quot;input-field&quot;&gt;
                      &lt;label class=&quot;active&quot;&gt;Images Upload&lt;/label&gt;
                      &lt;div class=&quot;input-images&quot; style=&quot;padding-top: .5rem;&quot; &gt;&lt;/div&gt;
  
                      @foreach ($roomDetails as $value)
                      &lt;img height=&quot;100px&quot; class=&quot;mt-4 m-4&quot; width=&quot;100px&quot; src=&quot;{{ 
                        Config('wfh.file') 
                       .$value-&gt;image}}&quot; alt=&quot;&quot;&gt;
                      &lt;input type=&quot;hidden&quot; name=&quot;images[]&quot; value=&quot;{{$value-&gt;image}}&quot; &gt;
                      @endforeach
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class=&quot;col-md-3&quot;&gt;
              &lt;div class=&quot;modal-footer&quot;&gt;
                  &lt;button type=&quot;submit&quot; id=&quot;btnSubmit&quot; class=&quot;btn btn-primary btn-lg w-100&quot;&gt;Add 
                   Room&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>