auto updates

This commit is contained in:
Andras Bacsai
2023-05-22 12:00:59 +02:00
parent 8f7fd4295e
commit e00ccf65cf
15 changed files with 147 additions and 38 deletions

View File

@@ -52,9 +52,15 @@ class User extends Authenticatable
$model->uuid = (string) new Cuid2(7);
});
}
public function isRoot()
public function isPartOfRootTeam()
{
return $this->id == 0;
$found_root_team = auth()->user()->teams->filter(function ($team) {
if ($team->id == 0) {
return true;
}
return false;
});
return $found_root_team->count() > 0;
}
public function teams()
{