From bff846a77d13d063f6381f7eadb17499f3da9dc7 Mon Sep 17 00:00:00 2001 From: Paolo A Date: Wed, 14 Aug 2024 15:43:28 +0000 Subject: [PATCH] Comm3 --- app/Console/Commands/GetFirstOrder.php | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 app/Console/Commands/GetFirstOrder.php diff --git a/app/Console/Commands/GetFirstOrder.php b/app/Console/Commands/GetFirstOrder.php new file mode 100644 index 00000000..2637517e --- /dev/null +++ b/app/Console/Commands/GetFirstOrder.php @@ -0,0 +1,38 @@ + 1]); + + if (!empty($orders) && isset($orders[0]->id)) { + // Mostra i dettagli del primo ordine + $this->info('First Order ID: ' . $orders[0]->id); + $this->info('Order Status: ' . $orders[0]->status); + $this->info('Total: ' . $orders[0]->total); + // Aggiungi altri dettagli se necessario + } else { + $this->error('No orders found.'); + } + } catch (\Exception $e) { + // Gestisci eventuali errori di connessione + $this->error('Error: ' . $e->getMessage()); + } + } +}