where('status', ApprovalStatus::PENDING_SUBMISSION)->get(); foreach ($invoices as $invoice) { $packingList = $invoice->owner; $order = $packingList->owner; try { (App()->make(ApproveShippingInvoiceTransactionProcessor::class))->execute($packingList); Log::info('Invoice Approved for reference ' . $order->reference . '.'); } catch (Exception $exception) { Log::info('Failed to Approve invoice for reference ' . $order->reference . '. Exception: ' . $exception->getMessage()); } } $end = new Carbon(); $elapsedTime = $start->diff($end)->format('%H:%I:%S'); Log::info(Carbon::now() . ': End job - Approve Invoice Command. ElapsedTime: ' . $elapsedTime . '.'); } }