From 6733778edfa7babfcca21b326f5b521f2b53ceb4 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Fri, 24 Sep 2021 13:38:12 +0800 Subject: [PATCH] fix change email module --- app/Http/Resources/CompanyResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Resources/CompanyResource.php b/app/Http/Resources/CompanyResource.php index d6c2ed9e..655cfc98 100644 --- a/app/Http/Resources/CompanyResource.php +++ b/app/Http/Resources/CompanyResource.php @@ -33,7 +33,7 @@ class CompanyResource extends JsonResource 'status' => (int) $this->status, 'contact' => new ContactResource ($this->when($this->has('contacts'), $this->contacts->first())), 'address' => new AddressResource($this->when($this->has('addresses'), $this->addresses->where('billing', true)->first())), - 'employee' => new UserResource(Auth::user()->type === RoleTypes::USER ? $this->employees()->where('email', '=', Auth::user()->email)->first() : $this->employees()->where('status', '=', ApprovalStatus::APPROVED)->orderBy('id', 'DESC')->first()), + 'employee' => new UserResource(Auth::user()->type === RoleTypes::USER ? $this->employees()->where('email', '=', Auth::user()->email)->first() : $this->employees()->where('users.status', '=', ApprovalStatus::APPROVED)->orderBy('id', 'DESC')->first()), 'identification' => new DocumentResource($this->documents->whereIn('document_type', DocumentType::IDENTIFICATION_DOCUMENTS)->first()), 'bookings' => $this->whenLoaded('bookings', $this->bookings()->orderBy('id', 'DESC')->get(), []), 'personal_banks' => BankResource::collection($this->banks->where('type', BankAccountType::PERSONAL)),