Custom Header Action In Resources

Hello guys,

Apology for the silly question. I'm new to filament.

I added a resource and I don't want the create button for the resource (Section). The sections are generated by a php code.

So I disabled the create method by

public static function canCreate(): bool
   {
      return false;
   }


and now I tried to add a custom function to header by adding this code in my resource class

use Filament\Actions\Action;
 
protected function getHeaderActions(): array
{
    return [
        Action::make('generate')
           ->label('Generate')
            ->url('some url'),
    ];
}


just to check if the button is visible

But the button is not added to the top
Solution
You should add this action on the ListPage
Was this page helpful?