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...
'; }