© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago•
3 replies
Mads Møller

custom action in v4 changes?

in v3 i would extend an action like this

class MyCustomAction extends Action
{
    protected function setUp(): void
    {
        parent::setUp();
        $someRecord = $this->getRecord();
    }
}
class MyCustomAction extends Action
{
    protected function setUp(): void
    {
        parent::setUp();
        $someRecord = $this->getRecord();
    }
}


Then use that custom action In a Page

protected function getHeaderActions(): array
{
    return [
        MyCustomAction::make('my-action')->record($this->getRecord()),
    ];
}
protected function getHeaderActions(): array
{
    return [
        MyCustomAction::make('my-action')->record($this->getRecord()),
    ];
}


Now in V4, $this->getRecord() is NULL because setUp() runs before the built in ->record() method.
So what is the best practise on extending Action in classes for v4? I could. not find anything in the new docs.
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

Hint Action in V4
FilamentFFilament / ❓┊help
2mo ago
[Filament V4] Custom page action not executing
FilamentFFilament / ❓┊help
7mo ago
Notification Action - V4
FilamentFFilament / ❓┊help
8mo ago
Custom Schema V4
FilamentFFilament / ❓┊help
8mo ago