© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•17mo ago•
22 replies
Zoltar

Action in custom page

Hello,

Have a simple button in blade view

<x-filament::button wire:click="challenge" class="primary-bg">
   Challenge
</x-filament::button>
<x-filament::button wire:click="challenge" class="primary-bg">
   Challenge
</x-filament::button>


in my custom page, function challenge() call an action

   //Challenge
    public function challenge()
    {   
        Action::make('sendEmail')
            ->form([
                TextInput::make('subject')->required(),
                RichEditor::make('body')->required(),
            ])
            ->action(function (array $data) {
                Mail::to($this->client)
                    ->send(new GenericEmail(
                        subject: $data['subject'],
                        body: $data['body'],
                    ));
            });
    }
   //Challenge
    public function challenge()
    {   
        Action::make('sendEmail')
            ->form([
                TextInput::make('subject')->required(),
                RichEditor::make('body')->required(),
            ])
            ->action(function (array $data) {
                Mail::to($this->client)
                    ->send(new GenericEmail(
                        subject: $data['subject'],
                        body: $data['body'],
                    ));
            });
    }


when try to click button get error

Method Filament\Notifications\Actions\Action::form does not exist.

any suggest?

thanks
Solution
The action name should match the function name
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Use Action in custom ViewRecord page
FilamentFFilament / ❓┊help
3y ago
Custom page with action
FilamentFFilament / ❓┊help
3y ago
Custom Action in the Resource Edit Page
FilamentFFilament / ❓┊help
2y ago
Infolist action on custom page
FilamentFFilament / ❓┊help
2y ago