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 button
Add Extra Button

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
                    */
                })
            ],
        );
    }
}
image.png
Was this page helpful?