© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
3 replies
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
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

custom view in a header action possible?
FilamentFFilament / ❓┊help
3y ago
Custom table action for related resources
FilamentFFilament / ❓┊help
3y ago
Including default header in custom header
FilamentFFilament / ❓┊help
17mo ago
Reset custom table header action modal form
FilamentFFilament / ❓┊help
2y ago