TenantAtlas/apps/platform/app/Filament/Resources/TenantResource/Pages/ManageTenantMemberships.php
Ahmed Darrazi 185f2795c6
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 1m45s
feat: retire legacy tenant route surfaces
2026-05-13 01:31:46 +02:00

46 lines
1.3 KiB
PHP

<?php
namespace App\Filament\Resources\TenantResource\Pages;
use App\Models\ManagedEnvironment;
use App\Support\ManagedEnvironmentLinks;
use Filament\Actions\Action;
class ManageTenantMemberships extends ViewTenant
{
protected static ?string $title = 'Manage environment access scope';
public function mount(int|string|ManagedEnvironment $tenant): void
{
parent::mount($tenant instanceof ManagedEnvironment ? (string) $tenant->getRouteKey() : $tenant);
}
public function getSubheading(): ?string
{
return 'Workspace membership defines the role. Explicit environment scopes only narrow which workspace members can see this environment.';
}
protected function getHeaderWidgets(): array
{
return [];
}
protected function getHeaderActions(): array
{
$actions = array_values(array_filter(
parent::getHeaderActions(),
static fn ($action): bool => ! ($action instanceof Action && $action->getName() === 'memberships'),
));
array_unshift(
$actions,
Action::make('back_to_overview')
->label('Back to environment overview')
->color('gray')
->url(fn (): string => ManagedEnvironmentLinks::viewUrl($this->getRecord())),
);
return $actions;
}
}