FilamentF
Filament8mo ago
Zwifs

Change action color and "reload" page

Hi!

I'm working on a simple resource, and want to add a refresh button to delete the cache, I want to change the action color and reload the form when done. How can I implement this? For the color I found the ->color method but that did not do anything.

class ManageChannels extends ManageRecords
{
    protected static string $resource = ChannelResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\CreateAction::make(),
            Actions\Action::make('refresh')
                ->action(function () {
                    Cache::delete('discord_service.getChannelList');
                }),
        ];
    }
}
Was this page helpful?