$user->id, ...$data, 'timezone' => config('app.timezone', 'UTC'), ]); $workspace->members()->attach($user->id, ['role' => Role::Owner->value]); $user->switchWorkspace($workspace); return $workspace; } }