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? }),
Solution
You can't do that. But you can use a dynamic label based on a condition:

->label(fn () => $condition ? 'Label 1' : 'Label 2')
Was this page helpful?