From ee575c21ea63d9ed9853632150bb21803b345c55 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 17 Feb 2023 13:06:52 +0800 Subject: [PATCH] auto generate invoices --- routes/web.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index eda16225..b8b95e8f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -752,8 +752,13 @@ Route::get('/generate/invoices', function(){ $postCodes = \App\Models\SegmentConstant::whereIn('reference', ['CENTER_POSTCODE', 'OUTSTATION_POSTCODE'])->get()->pluck('value')->flatten(); if(!!$billingAddress && in_array($deliveryAddress->postcode, $postCodes->toArray())){ - (App()->make(CreateInvoiceTransactionProcessor::class))->execute($packingList); - echo 'Invoice Generated...
'; + try { + (App()->make(CreateInvoiceTransactionProcessor::class))->execute($packingList); + echo 'Invoice Generated...
'; + + } catch (Exception $exception){ + echo 'failed to generate...
'; + } } echo 'failed to generate...
'; }