download do's for vt

This commit is contained in:
omair saleh
2021-11-11 16:30:25 +08:00
parent 1a3566e62a
commit d2ad5c3d9a
+2 -2
View File
@@ -75,12 +75,12 @@ Route::get('/test', function(){
Auth::login(User::findOrFail(1));
try {
$zip_file = 'cief_jun_to_september_delivery_orders.zip'; // Name of our archive to download
$zip_file = 'cief_oct_to_nov_11_delivery_orders.zip'; // Name of our archive to download
$zip = new ZipArchive();
if ($zip->open(storage_path().'/'.$zip_file, \ZipArchive::CREATE | \ZipArchive::OVERWRITE) === TRUE) {
//whereMonth('created_at', 5)->whereYear('created_at', 2021)->
$bookings = \App\Models\Booking::where('status', \App\Classes\ValueObjects\Constants\ApprovalStatus::COMPLETED)->where('updated_at', '>', Carbon::parse('04-10-2021'))->get();
$bookings = \App\Models\Booking::where('status', \App\Classes\ValueObjects\Constants\ApprovalStatus::COMPLETED)->where('updated_at', '>=', Carbon::parse('01-10-2021'))->get();
foreach ($bookings as $booking) {
$file = $booking->documents()->where('document_type', \App\Classes\ValueObjects\Constants\DocumentType::SUPPLIER_DELIVER_ORDER)->first()->files()->first();