where('status', ApprovalStatus::PENDING_SUBMISSION)->get(); foreach ($invoices as $invoice) { $packingList = $invoice->owner; $order = $packingList->owner; try { (App()->make(ApproveShippingInvoiceTransactionProcessor::class))->execute($packingList); $this->info('Invoice Approved for reference ' . $order->reference . '.'); } catch (Exception $exception) { $this->info('Failed to Approve invoice for reference ' . $order->reference . '. Exception: ' . $exception->getMessage()); } } } }