Refactor code to improve server limit retrieval in Team model
This commit is contained in:
parent
5a0c00977c
commit
3cb6ba1a9d
1 changed files with 5 additions and 1 deletions
|
|
@ -167,8 +167,12 @@ public static function serverLimit()
|
||||||
if (currentTeam()->id === 0 && isDev()) {
|
if (currentTeam()->id === 0 && isDev()) {
|
||||||
return 9999999;
|
return 9999999;
|
||||||
}
|
}
|
||||||
|
$team = Team::find(currentTeam()->id);
|
||||||
|
if (! $team) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return Team::find(currentTeam()->id)->limits['serverLimit'];
|
return data_get($team, 'limits.serverLimit', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function limits(): Attribute
|
public function limits(): Attribute
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue