fix: subscription / plan switch, etc

This commit is contained in:
Andras Bacsai
2024-02-23 12:59:14 +01:00
parent f931ebece8
commit f78fd212bb
10 changed files with 74 additions and 61 deletions

View File

@@ -159,6 +159,9 @@ class User extends Authenticatable implements SendsEmail
public function role()
{
if (data_get($this, 'pivot')) {
return $this->pivot->role;
}
return auth()->user()->teams->where('id', currentTeam()->id)->first()->pivot->role;
}
}