fix: isMember

This commit is contained in:
Andras Bacsai 2024-04-05 18:47:07 +02:00
parent 8fe658bacc
commit db8ffe50ac
3 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ public function mount()
if (!isCloud()) {
return redirect(RouteServiceProvider::HOME);
}
if (auth()->user()->isMember()) {
if (auth()->user()?->isMember()) {
return redirect()->route('dashboard');
}
if (data_get(currentTeam(), 'subscription') && isSubscriptionActive()) {

View File

@ -11,7 +11,7 @@ public function mount()
if (!isCloud()) {
return redirect()->route('dashboard');
}
if (auth()->user()->isMember()) {
if (auth()->user()?->isMember()) {
return redirect()->route('dashboard');
}
if (!data_get(currentTeam(), 'subscription')) {

View File

@ -22,7 +22,7 @@ class Team extends Model implements SendsDiscord, SendsEmail
protected static function booted()
{
static::saving(function ($team) {
if (auth()->user()->isMember()) {
if (auth()->user()?->isMember()) {
throw new \Exception('You are not allowed to update this team.');
}
});