title: Download multiple images as zip file using laravel 7
body: <p>I am trying to download images as zip file when i click to download button but unfortunately i am getting error please help me How can i resolve that thanks.</p>
  <p><strong>images path</strong></p>
  <p><a href="https://i.stack.imgur.com/f4iKu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f4iKu.png" alt="enter image description here" /></a></p>
  <p><strong>please check error</strong></p>
  <pre><code>https://flareapp.io/share/x7KOzgL7#F49
  </code></pre>
  <p><strong>controller</strong></p>
  <pre><code> public function dowload($id)
      {
  
  
            $inbox = InboxDetail::where('inbox_id', $id)-&gt;first();
  
          $zip = new \ZipArchive;
          $folderName =  $inbox-&gt;inbox_id ;
          $fileName    =   $folderName . '.zip';
  
          if ($zip-&gt;open(($fileName), ZipArchive::CREATE) === TRUE) {
  
              // $url = config('yourstitchart.file_url');
  
              $inboxFiles = InboxDetail::where('inbox_id', $id)-&gt;get();
  
                  $files =[];
              foreach ($inboxFiles as $i =&gt; $value) {
                  $files[$i] = (public_path('uploads\images/').$value-&gt;file);
              }
  
             //   dd($files);
  
            //   array:1 [▼
           //   0 =&gt; 
         &quot;C:\xampp\htdocs\demoproject\public\uploads\images/phpAEh0zK.png&quot;
              // ]
  
              foreach ($files as $file) {
                  $relativeNameInZipFile = basename($file);
                  $zip-&gt;addFile($file, $relativeNameInZipFile);
              }
  
              $zip-&gt;close();
          }
          return response()-&gt;download($fileName);
  
      }
  </code></pre>