© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Jaw

how to place create action on top of the table?

How can i place create action on top of the table?

public static function table(Table $table): Table
{
    return $table
        ->columns([
        ])
        ->filters([
            //
        ])
        ->headerActions([
            Tables\Actions\CreateAction::make('create')
                ->label('Add Unit')
                ->icon('heroicon-o-plus-small'),
        ])
        ->actions([
            Tables\Actions\ViewAction::make(),
            Tables\Actions\EditAction::make(),
            Tables\Actions\DeleteAction::make(),
        ])
        ->bulkActions([
            Tables\Actions\BulkActionGroup::make([
                Tables\Actions\DeleteBulkAction::make(),
            ]),
        ])
        ->emptyStateActions([
            Tables\Actions\CreateAction::make(),
        ]);
}
public static function table(Table $table): Table
{
    return $table
        ->columns([
        ])
        ->filters([
            //
        ])
        ->headerActions([
            Tables\Actions\CreateAction::make('create')
                ->label('Add Unit')
                ->icon('heroicon-o-plus-small'),
        ])
        ->actions([
            Tables\Actions\ViewAction::make(),
            Tables\Actions\EditAction::make(),
            Tables\Actions\DeleteAction::make(),
        ])
        ->bulkActions([
            Tables\Actions\BulkActionGroup::make([
                Tables\Actions\DeleteBulkAction::make(),
            ]),
        ])
        ->emptyStateActions([
            Tables\Actions\CreateAction::make(),
        ]);
}


if I remove the header action the
create action button
create action button
disappears.
image.png
Solution
never mind. i was missing create action inside list resource
<?php


use App\Filament\Resources\UnitResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListUnits extends ListRecords
{
    protected static string $resource = UnitResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\CreateAction::make(), // <-- missing this
        ];
    }
}
<?php


use App\Filament\Resources\UnitResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListUnits extends ListRecords
{
    protected static string $resource = UnitResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\CreateAction::make(), // <-- missing this
        ];
    }
}
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

add custom action on top of table
FilamentFFilament / ❓┊help
2y ago
Render Single Table action on different place
FilamentFFilament / ❓┊help
3y ago
How to create Action in table bottom?
FilamentFFilament / ❓┊help
3y ago
Action Buttons on Top of Page
FilamentFFilament / ❓┊help
3y ago