mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 14:06:15 +00:00
2.x docker
This commit is contained in:
@ -72,8 +72,13 @@ public static function boot(): void
|
||||
parent::boot();
|
||||
|
||||
static::created(function (User $user) {
|
||||
if (Project::count() === 0) {
|
||||
if ($user->projects()->count() === 0) {
|
||||
$user->createDefaultProject();
|
||||
$user->refresh();
|
||||
}
|
||||
if (! $user->currentProject) {
|
||||
$user->current_project_id = $user->projects()->first()->id;
|
||||
$user->save();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user