fix: isMember
This commit is contained in:
parent
8fe658bacc
commit
db8ffe50ac
@ -15,7 +15,7 @@ public function mount()
|
|||||||
if (!isCloud()) {
|
if (!isCloud()) {
|
||||||
return redirect(RouteServiceProvider::HOME);
|
return redirect(RouteServiceProvider::HOME);
|
||||||
}
|
}
|
||||||
if (auth()->user()->isMember()) {
|
if (auth()->user()?->isMember()) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
if (data_get(currentTeam(), 'subscription') && isSubscriptionActive()) {
|
if (data_get(currentTeam(), 'subscription') && isSubscriptionActive()) {
|
||||||
|
@ -11,7 +11,7 @@ public function mount()
|
|||||||
if (!isCloud()) {
|
if (!isCloud()) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
if (auth()->user()->isMember()) {
|
if (auth()->user()?->isMember()) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
if (!data_get(currentTeam(), 'subscription')) {
|
if (!data_get(currentTeam(), 'subscription')) {
|
||||||
|
@ -22,7 +22,7 @@ class Team extends Model implements SendsDiscord, SendsEmail
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::saving(function ($team) {
|
static::saving(function ($team) {
|
||||||
if (auth()->user()->isMember()) {
|
if (auth()->user()?->isMember()) {
|
||||||
throw new \Exception('You are not allowed to update this team.');
|
throw new \Exception('You are not allowed to update this team.');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user