diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 9dc80bbd..7c72357b 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -33,7 +33,7 @@ class Kernel extends ConsoleKernel $schedule->call(function(){ $zipname = 'do_'.Carbon::today()->format('Y_m_d').'.zip'; $zip = new ZipArchive; - $zip->open($zipname, ZipArchive::CREATE); + $zip->open(public_path().'/'.$zipname, ZipArchive::CREATE); $approvedInvoices = InvoiceStatuses::where('status', 'approve')->whereDate('created_at', Carbon::today())->distinct()->get(['invoice_id']); $bookings = []; foreach($approvedInvoices as $approved){ @@ -43,7 +43,6 @@ class Kernel extends ConsoleKernel $do = app(InvoiceController::class)->generateSupplierDo($id); $zip->addFromString('do_'.Carbon::today()->format('Y_m_d').'_'.$id.'.pdf', $do->Output('do.pdf', 'S')); } - $zip->extractTo(public_path()); $zip->close(); $attachment = public_path($zipname);