diff --git a/app/CustomFuncPao.php b/app/CustomFuncPao.php index a71a2e7b..3c9087f8 100644 --- a/app/CustomFuncPao.php +++ b/app/CustomFuncPao.php @@ -241,11 +241,13 @@ function showOrdini() { $str = "Ordini"; - - $orders = Orderdetail::orderBy('id', 'desc')->take(2)->get(); try { + $orders = Orderdetail::orderBy('id', 'desc') + ->take(2) + ->get(); + // Show the fields of the orders foreach ($orders as $order) { $str .= "Ordine: "; @@ -264,7 +266,7 @@ function showOrdini1() { $str = "Ordini"; - + $orders = Order::orderBy('DataOra', 'desc')->take(2)->get(); try {