Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $zip = new \ZipArchive();
- $zip->open($zip_file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE);
- $data = \DB::table('upload_document')->where('kelompok_jawaban_revisi',$kelompok)->get();
- foreach ($data as $dt) {
- $invoice_file = 'uploads/'.$dt->file_name;
- $zip->addFile($invoice_file, $invoice_file);
- }
- $zip->close();
- // We return the file immediately after download
- return response()->download($zip_file);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement