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'); ?> +
+ +
+

Order order_number); ?>

+

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:

+
+ + 📥 Download Sticker (A6 PDF) + +
+
+ uuid}.svg")); ?> + +
+
+
+ + + status === 'inspection'): ?> + make('ops.actions.inspection', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?> + status === 'packing' || $order->status === 'printing'): ?> + make('ops.actions.packing', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?> + status, ['ready_to_ship', 'awaiting_collection', 'in_transit'])): ?> + make('ops.actions.read-only', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?> + +
+

No actions available for this order status.

+
+ + + +
+

Order Items

+
+ + + + + + + + + + + items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?> + + + + + + + popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?> + + + + + +
ProductTypeQuantityAmount
product->name ?? 'N/A'); ?>product_type ?? 'N/A'); ?>quantity); ?>Runit_price * $item->quantity, 2)); ?>
No items
+
+
+ + + packing_completed_at): ?> +
+

Packing Details

+
+
+

Width

+

packing_width); ?> cm

+
+
+

Length

+

packing_length); ?> cm

+
+
+

Weight

+

packing_weight); ?> kg

+
+
+

Packed At

+

packing_completed_at->format('M d, H:i')); ?>

+
+
+
+ + + + courier_waybill_id): ?> +
+

Shipment Details

+
+
+

Waybill ID

+

courier_waybill_id); ?>

+
+
+

Tracking Number

+

courier_tracking_number ?? 'N/A'); ?>

+
+
+

Status

+

courier_status ?? 'pending')); ?>

+
+
+
+ +
+stopSection(); ?> + +make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?> \ No newline at end of file