tenantFromRecord() ->apply( Actions\Action::make('archive') ->label('Archive') ->color('danger') ->requiresConfirmation() ->visible(fn (): bool => $this->record instanceof Tenant && ! $this->record->trashed()) ->action(function (): void { $tenant = $this->record; UiEnforcement::for(Capabilities::TENANT_DELETE) ->tenantFromRecord() ->authorizeOrAbort($tenant); $tenant->delete(); }), ), ]; } }