F
Filamentβ€’8mo ago
Nibir Ahmed

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;
}
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'),
];
}
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
Jump to solution
2 Replies
Solution
LeandroFerreira
LeandroFerreiraβ€’8mo ago
You should add this action on the ListPage
Nibir Ahmed
Nibir Ahmedβ€’8mo ago
Thanks tons it worked πŸ˜€