From 8725977068fd9ba01a6a15f6c4f05c7bee161df3 Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Sun, 3 Dec 2023 15:21:24 +0100 Subject: [PATCH] Fix owns user methods --- app/Models/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index 492aa1b..0ec9698 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -59,12 +59,12 @@ class User extends Authenticatable implements JWTSubject public function ownsForm(Form $form) { - return $this->workspaces()->whereUserId($form->workspace_id)->exists(); + return $this->workspaces()->where('workspaces.id',$form->workspace_id)->exists(); } public function ownsWorkspace(Workspace $workspace) { - return $this->workspaces()->whereUserId($workspace->id)->exists(); + return $this->workspaces()->where('workspaces.id',$workspace->id)->exists(); } /**