From 7d273b5ce66292f14d3de9397bf1232d955ffd8e Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 23 Feb 2022 21:37:02 +0800 Subject: [PATCH] Merge branch 'master' of gitlab.com:CIEFWorldwideSdnBhd/shipping-portal into development # Conflicts: # app/Classes/Modules/PackingLists/Processors/FetchOrderListsFromYdPortalProcessor.php --- app/Http/Resources/CompanyResource.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Resources/CompanyResource.php b/app/Http/Resources/CompanyResource.php index 6d16651b..38459a35 100644 --- a/app/Http/Resources/CompanyResource.php +++ b/app/Http/Resources/CompanyResource.php @@ -28,10 +28,10 @@ class CompanyResource extends JsonResource 'business_type' => (int) $this->business_type, 'status' => (int) $this->status, 'contact' => new ContactResource ($this->when($this->has('contacts'), $this->contacts->first())), - 'employee' => (int) $this->business_type == 1 ? new UserResource($companyModule->employees()->first()) : '', + 'employee' => new UserResource($companyModule->employees()->first()), 'company_module' => new CompanyModuleResource($companyModule), - 'last_order' => (int) $this->business_type == 1 ? new OrderResource($companyModule ? $companyModule->orders()->orderBy('id', 'DESC')->first(): null) : '', - 'order_count' => (int) $this->business_type == 1 ? $this->orders()->count() : '', + 'last_order' => new OrderResource($companyModule ? $companyModule->orders()->orderBy('id', 'DESC')->first(): null), + 'order_count' => $this->orders()->count(), 'identification' => new DocumentResource($this->documents->whereIn('document_type', DocumentType::IDENTIFICATION_DOCUMENTS)->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED])->first()), 'created_at' => $this->created_at->format('d-m-Y')