Fix owns user methods

This commit is contained in:
Julien Nahum 2023-12-03 15:21:24 +01:00
parent 57c695e976
commit 8725977068
1 changed files with 2 additions and 2 deletions

View File

@ -59,12 +59,12 @@ class User extends Authenticatable implements JWTSubject
public function ownsForm(Form $form) 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) public function ownsWorkspace(Workspace $workspace)
{ {
return $this->workspaces()->whereUserId($workspace->id)->exists(); return $this->workspaces()->where('workspaces.id',$workspace->id)->exists();
} }
/** /**