© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
3 replies
優→優→欸→廚・

Add / Change the Display Value and Action on Form Buttons

Hello! I'm facing some issues with the default display values. I need to change the default display values and action to every buttons on the form.

And I have spent a lot of time searching and have also tried implementing suggestions provided by others, but I still haven't been able to resolve the issue. Can someone help me, please?


Add & Change the Default Buttom of Form

I found this page. And then I tried to add this in into my code. But it was not change anything when I press the
New category
New category
button
Add Extra Button

Filament\Resources\CategoryResource\Pages\ManageCategories.php
Filament\Resources\CategoryResource\Pages\ManageCategories.php

<?php

namespace App\Filament\Resources\CategoryResource\Pages;

use App\Filament\Resources\CategoryResource;
use Filament\Pages;
use Filament\Actions;
use Filament\Resources\Pages\ManageRecords;

class ManageCategories extends ManageRecords
{
    protected static string $resource = CategoryResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Pages\Actions\CreateAction::make(),
        ];
    }

    /**
    * add these in
    */
    protected function getFormActions(): array
    {
        return array_merge(parent::getFormActions(), [
            Actions\Action::make('Clear')
                ->action(function () {
                    /*
                    * code the action here
                    */
                })
            ],
        );
    }
}
<?php

namespace App\Filament\Resources\CategoryResource\Pages;

use App\Filament\Resources\CategoryResource;
use Filament\Pages;
use Filament\Actions;
use Filament\Resources\Pages\ManageRecords;

class ManageCategories extends ManageRecords
{
    protected static string $resource = CategoryResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Pages\Actions\CreateAction::make(),
        ];
    }

    /**
    * add these in
    */
    protected function getFormActions(): array
    {
        return array_merge(parent::getFormActions(), [
            Actions\Action::make('Clear')
                ->action(function () {
                    /*
                    * code the action here
                    */
                })
            ],
        );
    }
}
image.png
Laravel Daily
Filament: Add Custom Button to Form - Reset Example to Clear Fields
Filament: Add Custom Button to Form - Reset Example to Clear Fields
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 header Form action buttons
FilamentFFilament / ❓┊help
13mo ago
Add model on action form
FilamentFFilament / ❓┊help
16mo ago
Hide action based on form change
FilamentFFilament / ❓┊help
2y ago
Add Button Form Action
FilamentFFilament / ❓┊help
2y ago