This commit is contained in:
Andras Bacsai
2023-06-16 15:56:25 +02:00
parent ab1ea30dec
commit 8f3ef2b1c5
19 changed files with 130 additions and 23 deletions

View File

@@ -79,4 +79,11 @@ class Team extends Model implements SendsDiscord, SendsEmail
$sources = $sources->merge($github_apps)->merge($gitlab_apps);
return $sources;
}
public function isEmpty()
{
if ($this->projects()->count() === 0 && $this->servers()->count() === 0 && $this->privateKeys()->count() === 0 && $this->sources()->count() === 0) {
return true;
}
return false;
}
}

View File

@@ -30,7 +30,6 @@ class User extends Authenticatable implements SendsEmail
protected static function boot()
{
parent::boot();
static::created(function (User $user) {
$team = [
'name' => $user->name . "'s Team",
@@ -48,6 +47,7 @@ class User extends Authenticatable implements SendsEmail
{
return $this->email;
}
public function isAdmin()
{
if (auth()->user()->id === 0) {