diff --git a/routes/web.php b/routes/web.php index 95850b9a..52a0146e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -865,11 +865,14 @@ Route::get('/invoices/combine/{ids}', function($ids){ // })->name('generate.invoices'); Route::get('/invoices/approve', function(Request $request){ -// whereDoesntHave $invoices = Transaction::where('type', TransactionType::SHIPPING_INVOICE)->where('status', ApprovalStatus::PENDING_SUBMISSION)->get(); foreach ($invoices as $invoice) { $packingList = $invoice->owner; + if (!$packingList) { + dump ('Error packingList not found. Invoice ID - ' . $invoice->id); + continue; + } $order = $packingList->owner; if ($request->input('exclude')){