From 341421d2a0652d4b4e27db790ed3bfdedfb316e9 Mon Sep 17 00:00:00 2001 From: twotalesanimation <80506065+twotalesanimation@users.noreply.github.com> Date: Fri, 2 Jan 2026 21:17:51 +0200 Subject: [PATCH] fix: Return available actions from getAvailableActions() method The match statement wasn't returning the actions array, causing no actions to display on inspection orders. Changed to directly return the match result. --- app/Http/Controllers/OpsController.php | 14 +- .../3eb3669279660d3820de15e6e8eeb5d9.php | 141 ++++++++++++++++++ 2 files changed, 146 insertions(+), 9 deletions(-) create mode 100644 storage/framework/views/3eb3669279660d3820de15e6e8eeb5d9.php diff --git a/app/Http/Controllers/OpsController.php b/app/Http/Controllers/OpsController.php index d2b49e1..94dc817 100644 --- a/app/Http/Controllers/OpsController.php +++ b/app/Http/Controllers/OpsController.php @@ -182,23 +182,19 @@ class OpsController extends Controller */ private function getAvailableActions(Order $order): array { - $actions = []; - - match ($order->status) { + return match ($order->status) { 'inspection' => [ - $actions['markInspectionPassed'] = true, - $actions['flagInspectionIssue'] = true, + 'markInspectionPassed' => true, + 'flagInspectionIssue' => true, ], 'packing' => [ - $actions['confirmPacking'] = true, + 'confirmPacking' => true, ], 'ready_to_ship', 'awaiting_collection', 'in_transit' => [ - $actions['readOnly'] = true, + 'readOnly' => true, ], default => [] }; - - return $actions; } /** diff --git a/storage/framework/views/3eb3669279660d3820de15e6e8eeb5d9.php b/storage/framework/views/3eb3669279660d3820de15e6e8eeb5d9.php new file mode 100644 index 0000000..5cca5de --- /dev/null +++ b/storage/framework/views/3eb3669279660d3820de15e6e8eeb5d9.php @@ -0,0 +1,141 @@ + + +startSection('content'); ?> +
uuid); ?>
+Status
+status)); ?>
+Order Type
+is_custom_order ? 'Custom' : 'Standard'); ?>
+Customer
+user->name ?? 'N/A'); ?>
+Created
+created_at->format('M d, Y')); ?>
+Scan to access this order:
+No actions available for this order status.
+| Product | +Type | +Quantity | +Amount | +
|---|---|---|---|
| product->name ?? 'N/A'); ?> | +product_type ?? 'N/A'); ?> | +quantity); ?> | +Runit_price * $item->quantity, 2)); ?> | +
| No items | +|||
Width
+packing_width); ?> cm
+Length
+packing_length); ?> cm
+Weight
+packing_weight); ?> kg
+Packed At
+packing_completed_at->format('M d, H:i')); ?>
+Waybill ID
+courier_waybill_id); ?>
+Tracking Number
+courier_tracking_number ?? 'N/A'); ?>
+Status
+courier_status ?? 'pending')); ?>
+