Hide header actions on edit page

Hello!

I'm looking to customize the "delete" button on the edit page, to only show conditionally on my records.

Is there a way to achieve this? Thanks!
Solution
Solved! I wanted to disable the delete button if the current user editing is the same as the user in the model.

So in EditUser.php:

class EditUser extends EditRecord
{
    protected static string $resource = UserResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\DeleteAction::make()
                ->disabled(auth()->id() == $this->record->id),
        ];
    }
}
Was this page helpful?