From 867e2455b34b7e25909598017ab99540b67f7f2a Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 20 May 2024 01:39:36 +0800 Subject: [PATCH] Laravel Vapor - Debug Endpoint request timed out --- app/Http/Resources/PackingListWithStorageResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Resources/PackingListWithStorageResource.php b/app/Http/Resources/PackingListWithStorageResource.php index dfbeda76..386af053 100644 --- a/app/Http/Resources/PackingListWithStorageResource.php +++ b/app/Http/Resources/PackingListWithStorageResource.php @@ -22,7 +22,7 @@ class PackingListWithStorageResource extends JsonResource public function toArray($request) { $exceptionUsers = in_array(Auth()->user()->type, [RoleTypes::SHADOW_ADMIN, RoleTypes::SUPER_ADMIN]); - $packages = []; //!$this->packingLists()->exists() || $exceptionUsers ? $this->packages : $this->packingLists->first()->packages; //cief todo: Disable, some query may need it, e.g. pending approval tab + $packages = !$this->packingLists()->exists() || $exceptionUsers ? $this->packages : $this->packingLists->first()->packages; $shippingTransaction = $this->transactions()->where('type', TransactionType::SHIPPING_INVOICE)->whereNotIn('status', [ApprovalStatus::SUSPENDED, ApprovalStatus::EXPIRED])->first(); $transactions = $this->transactions()->whereNotIn('transactions.status', [0, 1])->whereIn('transactions.type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get(); $storages = [];