Helper Text as Action not working

in my resource file, in form under a field my helper text is rendering but i want to trigger an action when clicking on it

function in resource
public function testAction(): Action { return Action::make('test') ->requiresConfirmation() ->action(function (array $arguments) { dd('Test action called', $arguments); }); }

PhoneInput::make('telephone') ->label('Phone') ->required() ->helperText(function () { return view('forms.components.duplicate-hint' ); }) ->live(),
blade file for helper text
@if(isset($duplicates) && $duplicates->isNotEmpty()) <div> <button wire:click="mountAction('test', { id: 12345 })" style="color:red; text-decoration: underline;"> Duplicate(s) found! </button> </div> <x-filament-actions::modals /> @endif

but my action is not triggering
Solution
you should create this action in your pages, CreatePage, EditPage, because they are livewire components
Was this page helpful?