label(__('admin.refresh_tokens.actions.revoke')) ->icon('heroicon-o-no-symbol') ->color('danger') ->visible(fn (): bool => $this->record->isActive()) ->form([ Forms\Components\Select::make('reason') ->label(__('admin.refresh_tokens.fields.revoked_reason')) ->options([ 'manual' => __('admin.refresh_tokens.reasons.manual'), 'operator' => __('admin.refresh_tokens.reasons.operator'), ]) ->default('manual') ->required(), Forms\Components\Textarea::make('note') ->label(__('admin.refresh_tokens.fields.note')) ->rows(2) ->maxLength(255), ]) ->requiresConfirmation() ->action(function (array $data): void { $note = $data['note'] ?? null; $this->record->revoke( $data['reason'] ?? 'manual', auth()->id(), request(), $note ? ['note' => $note] : [] ); $this->record->refresh(); $this->notify('success', __('admin.refresh_tokens.notifications.revoked')); }), ]; } }