add action to group header table

im trying to add delete action button to group header at table but its not working, it only do quick spin and then back to normal state.

what i do to render the action button is make function in ListRecord
    public function renderGroupDeleteAction($id)
    {
        return Actions\Action::make('delete')
            ->requiresConfirmation()
            ->record(Category::find($id))
            ->action(function ($record) {
                \Log::info('test ' . $record->id);
                if($record->delete()) {
                    Notification::make()
                        ->title('Delete record ' . $record->id . ' successfully')
                        ->success()
                        ->send();
                }
            })
            ->icon("heroicon-m-trash")
            ->iconButton()
            ->color('danger')
            ->render();
    }

and use it on group\header.blade
  {!! $this->renderGroupDeleteAction($id) !!}


did i use it wrong ?
image.png
Was this page helpful?