From 0654f0335b4de7846f4f94f769079e9028399ec7 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 17 Feb 2023 12:51:15 +0800 Subject: [PATCH] auto generate invoices --- routes/web.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index 21f5fb06..1d28dc08 100644 --- a/routes/web.php +++ b/routes/web.php @@ -745,7 +745,7 @@ Route::get('/generate/invoices', function(){ $billingAddress = $companyModule->addresses()->where('type', \App\Classes\ValueObjects\Constants\AddressType::BILLING)->first(); $deliveryAddress = $order->addresses()->where('status', ApprovalStatus::APPROVED)->first(); - $postCodes = \App\Models\SegmentConstant::whereIn('reference', ['CENTER_POSTCODE', 'OUTSTATION_POSTCODE'])->get()->pluck('value'); + $postCodes = \App\Models\SegmentConstant::whereIn('reference', ['CENTER_POSTCODE', 'OUTSTATION_POSTCODE'])->get()->pluck('value')->flatten(); dump($deliveryAddress->postcode, $postCodes->toArray()); if(!!$billingAddress && in_array($deliveryAddress->postcode, $postCodes->toArray())){