Advertisement
fadlyshafa

Untitled

Aug 27th, 2019
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. $zip = new \ZipArchive();
  2.         $zip->open($zip_file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE);
  3.  
  4.         $data = \DB::table('upload_document')->where('kelompok_jawaban_revisi',$kelompok)->get();
  5.  
  6.         foreach ($data as $dt) {
  7.             $invoice_file = 'uploads/'.$dt->file_name;
  8.  
  9.             $zip->addFile($invoice_file, $invoice_file);
  10.         }
  11.  
  12.         $zip->close();
  13.  
  14. // We return the file immediately after download
  15.         return response()->download($zip_file);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement