© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
6 replies
MaSTeRMinD

Change Action Label from action method

example code
Action::make('test-1')
    ->label('ChangeMe')
    ->icon('heroicon-m-sparkles')
    ->action(function () {
        //change label ChangeMe from here?
    }),
Action::make('test-1')
    ->label('ChangeMe')
    ->icon('heroicon-m-sparkles')
    ->action(function () {
        //change label ChangeMe from here?
    }),
Solution
You can't do that. But you can use a dynamic label based on a condition:

->label(fn () => $condition ? 'Label 1' : 'Label 2')
->label(fn () => $condition ? 'Label 1' : 'Label 2')
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

Call action method from livewire
FilamentFFilament / ❓┊help
3y ago
Change Summary label
FilamentFFilament / ❓┊help
15mo ago
Extend group action label
FilamentFFilament / ❓┊help
3mo ago
Hide label for action
FilamentFFilament / ❓┊help
3y ago