From ff50c6413f72ae518fa68879fc6cbf5c27011268 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 8 Oct 2021 21:23:51 +1100 Subject: [PATCH] Fixes for deleted invoices showing in portal --- app/Http/Controllers/ClientPortal/InvitationController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ClientPortal/InvitationController.php b/app/Http/Controllers/ClientPortal/InvitationController.php index 39425b8650e2..bf72b36a0c84 100644 --- a/app/Http/Controllers/ClientPortal/InvitationController.php +++ b/app/Http/Controllers/ClientPortal/InvitationController.php @@ -75,7 +75,10 @@ class InvitationController extends Controller $entity_obj = 'App\Models\\'.ucfirst(Str::camel($entity)).'Invitation'; - $invitation = $entity_obj::whereRaw('BINARY `key`= ?', [$invitation_key]) + $invitation = $entity_obj::where('key', $invitation_key) + ->whereHas($entity, function ($query) { + $query->where('is_deleted',0); + }) ->with('contact.client') ->firstOrFail();