Create common function for userIsFormOwner & rewrite protected form (#244)

* Create common function for userIsFormOwner & rewrite protected form

* fix testcase
This commit is contained in:
formsdev
2023-11-28 15:53:04 +05:30
committed by GitHub
parent 64e79f34f2
commit d65c1be9b5
6 changed files with 39 additions and 34 deletions

View File

@@ -61,6 +61,11 @@ class User extends Authenticatable implements JWTSubject
protected $withCount = ['workspaces'];
public function ownsForm(Form $form)
{
return $this->workspaces()->find($form->workspace_id) !== null;
}
/**
* Get the profile photo URL attribute.
*