© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
40 replies
ericmp #2

How to place form actions on header actions

this is what i've tried, the problem is that when i click save in the header action save btn, it doesnt do anything

<?php

namespace App\Filament\Resources\FormResource\Pages;

use App\Filament\Resources\FormResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;
use Filament\Support\Colors\Color;

class CreateForm extends CreateRecord
{
    protected static string $resource = FormResource::class;

    protected static bool $canCreateAnother = false;

    protected function getHeaderActions(): array
    {
        return [
            Actions\Action::make('cancel')
                ->label(__('filament-panels::resources/pages/create-record.form.actions.cancel.label'))
                ->color('gray')
                ->url(route('filament.admin.resources.forms.index'))
                ->icon('heroicon-o-backspace')
            ,
            $this->getCreateFormAction()->icon('heroicon-m-cloud-arrow-down')->color(Color::Teal),
        ];
    }

    protected function getFormActions(): array
    {
        return [
            $this->getCreateFormAction()->icon('heroicon-m-cloud-arrow-down')->color(Color::Teal), // ⚠️ this should be deleted, as we use it in header actions. but the one in header actions doesnt work, why?
            //
        ];
    }

    protected function getCreateFormAction(): Actions\Action
    {
        return Actions\Action::make('create')
            ->label(__('filament-panels::resources/pages/create-record.form.actions.create.label'))
            ->submit('create')
            ->keyBindings(['mod+s'])
        ;
    }
}
<?php

namespace App\Filament\Resources\FormResource\Pages;

use App\Filament\Resources\FormResource;
use Filament\Actions;
use Filament\Resources\Pages\CreateRecord;
use Filament\Support\Colors\Color;

class CreateForm extends CreateRecord
{
    protected static string $resource = FormResource::class;

    protected static bool $canCreateAnother = false;

    protected function getHeaderActions(): array
    {
        return [
            Actions\Action::make('cancel')
                ->label(__('filament-panels::resources/pages/create-record.form.actions.cancel.label'))
                ->color('gray')
                ->url(route('filament.admin.resources.forms.index'))
                ->icon('heroicon-o-backspace')
            ,
            $this->getCreateFormAction()->icon('heroicon-m-cloud-arrow-down')->color(Color::Teal),
        ];
    }

    protected function getFormActions(): array
    {
        return [
            $this->getCreateFormAction()->icon('heroicon-m-cloud-arrow-down')->color(Color::Teal), // ⚠️ this should be deleted, as we use it in header actions. but the one in header actions doesnt work, why?
            //
        ];
    }

    protected function getCreateFormAction(): Actions\Action
    {
        return Actions\Action::make('create')
            ->label(__('filament-panels::resources/pages/create-record.form.actions.create.label'))
            ->submit('create')
            ->keyBindings(['mod+s'])
        ;
    }
}
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Swap Header Actions with Form Actions
FilamentFFilament / ❓┊help
2y ago
Place date picker filter on table header actions
FilamentFFilament / ❓┊help
7mo ago
EditForm - can't submit form action on set on form header actions
FilamentFFilament / ❓┊help
3y ago
How to test Header/Footer Actions in a Section Form Component
FilamentFFilament / ❓┊help
2y ago