I tried to do it with this code, but I didn't know how to download it after I created the zip file.
here's my code in controller:
//Convert data into pdf then save it to local storage
$apply = Form::all();
view()->share('apply', $apply);
$pdf = PDF::loadView('admin.pdf-apply')->setPaper('a4', 'landscape');
Storage::put('public/pdf/data_applicant.pdf', $pdf->output());
//Create a zip from it and download it
$zip = Zip::create('public/storage/file.zip');
Storage::put('public/pdf/file.zip', $zip->add('public/storage/pdf/data_applicant.pdf'));
$zip->close();
return response()->download($zip);
I tried to do it with this code, but I didn't know how to download it after I created the zip file.
here's my code in controller: