form->fill([ 'pin' => '', ]); } protected function getFormSchema(): array { return [ TextInput::make('pin') ->label('Support PIN') ->required() ->minLength(4) ->maxLength(16) ->placeholder('Enter PIN shared by client') ->autocomplete('off'), ]; } public function validatePin(SupportPinService $service): void { $pin = $this->pin; // <-- access the bound property $this->validated = null; $this->errorMessage = null; $record = $service->validate($pin); if (!$record) { $this->errorMessage = 'No active PIN matched the value provided.'; Notification::make() ->title('Support PIN not found or expired') ->danger() ->send(); return; } $this->validated = [ 'user_name' => $record->user?->name, 'user_email' => $record->user?->email, 'expires_at' => $record->expires_at?->toDayDateTimeString(), 'last_validated_at' => $record->last_validated_at?->toDayDateTimeString(), 'user_id' => $record->user?->getKey(), 'user_url' => $record->user ? UserResource::getUrl('edit', ['record' => $record->user]) : null, ]; Notification::make() ->title('Support PIN validated') ->success() ->send(); } public static function canAccess(): bool { $user = Auth::user(); return $user && $user->hasPermission('admin.compliance.validate_pin'); } // Required to avoid Filament 2 breadcrumb error public function getBreadcrumbs(): array { return []; } }