Select a workspace to continue.
@php $workspaces = $this->getWorkspaces(); $workspaceRoles = $this->workspaceRoles; $user = auth()->user(); $recommendedWorkspaceId = $user instanceof \App\Models\User ? (int) ($user->last_workspace_id ?? 0) : 0; if ($recommendedWorkspaceId > 0) { [$recommended, $other] = $workspaces->partition(fn ($workspace) => (int) $workspace->id === $recommendedWorkspaceId); $workspaces = $recommended->concat($other)->values(); } $roleColorMap = [ 'owner' => 'primary', 'manager' => 'info', 'operator' => 'gray', 'readonly' => 'gray', ]; @endphp @if ($workspaces->isEmpty())
You don't have access to any workspace yet.
@else
@foreach ($workspaces as $workspace) @php $isRecommended = $recommendedWorkspaceId > 0 && (int) $workspace->id === $recommendedWorkspaceId; $role = $workspaceRoles[(int) $workspace->id] ?? null; $tenantCount = (int) ($workspace->tenants_count ?? 0); @endphp
{{ $workspace->name }}
@if ($isRecommended) Last used @endif @if ($role) {{ ucfirst($role) }} @endif
{{ $tenantCount }} {{ \Illuminate\Support\Str::plural('tenant', $tenantCount) }}
@endforeach
@php $canManageWorkspaces = false; if ($user instanceof \App\Models\User && $workspaces->count() > 0) { foreach ($workspaces as $ws) { $wsRole = $workspaceRoles[(int) $ws->id] ?? null; if ($wsRole === 'owner') { $canManageWorkspaces = true; break; } } } @endphp @if ($canManageWorkspaces) @endif @endif