TenantAtlas/apps/platform/resources/views/filament/partials/workspace-switcher.blade.php
ahmido ce0615a9c1 Spec 182: relocate Laravel platform to apps/platform (#213)
## Summary
- move the Laravel application into `apps/platform` and keep the repository root for orchestration, docs, and tooling
- update the local command model, Sail/Docker wiring, runtime paths, and ignore rules around the new platform location
- add relocation quickstart/contracts plus focused smoke coverage for bootstrap, command model, routes, and runtime behavior

## Validation
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/PlatformRelocation`
- integrated browser smoke validated `/up`, `/`, `/admin`, `/admin/choose-workspace`, and tenant route semantics for `200`, `403`, and `404`

## Remaining Rollout Checks
- validate Dokploy build context and working-directory assumptions against the new `apps/platform` layout
- confirm web, queue, and scheduler processes all start from the expected working directory in staging/production
- verify no legacy volume mounts or asset-publish paths still point at the old root-level `public/` or `storage/` locations

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #213
2026-04-08 08:40:47 +00:00

48 lines
1.8 KiB
PHP

@php
/** @var \App\Support\Workspaces\WorkspaceContext $workspaceContext */
$workspaceContext = app(\App\Support\Workspaces\WorkspaceContext::class);
$user = auth()->user();
$currentWorkspaceId = $workspaceContext->currentWorkspaceId(request());
$workspaces = collect();
if ($user instanceof \App\Models\User) {
$workspaces = \App\Models\Workspace::query()
->whereIn('id', function ($query) use ($user): void {
$query->from('workspace_memberships')
->select('workspace_id')
->where('user_id', $user->getKey());
})
->whereNull('archived_at')
->orderBy('name')
->get();
}
@endphp
@if ($workspaces->isNotEmpty())
<x-filament::dropdown.list>
<div class="px-3 py-2">
<form method="POST" action="{{ route('admin.switch-workspace') }}" class="space-y-2">
@csrf
<div class="text-xs font-medium text-gray-500 dark:text-gray-400">Switch workspace</div>
<select
name="workspace_id"
class="fi-input fi-select w-full"
x-data
x-on:change="$el.form.submit()"
>
@foreach ($workspaces as $workspace)
<option value="{{ $workspace->getKey() }}" {{ (int) $workspace->getKey() === (int) $currentWorkspaceId ? 'selected' : '' }}>
{{ $workspace->name }}
</option>
@endforeach
</select>
<div class="text-xs text-gray-500 dark:text-gray-400">Select a workspace to switch context.</div>
</form>
</div>
</x-filament::dropdown.list>
@endif