DEF STUDIO srl

Need help with Laravel and web development?

Hire one of our experts for your projects.

We build tailored products, websites and platforms — with care for UX, performance and maintainability.

Booking open for Q4 — limited slots

You are seeing the documentation for version 1, but the last version for this package is v1. Click here to go to the last version.

Interact With The Chat Keyboard

The keyboard that triggered the callback can be retrieved through the $originalKeyboard property, a Keyboard object that holds the buttons and can be manipulated with some dedicated methods:

replaceKeyboard

The entire keyboard can be replaced using the ->replaceKeyboard() method:

class CustomWebhookHandler extends WebhookHandler
{
    public function dismiss(){
        //...

        $newKeyboard = $this->originalKeyboard
            ->deleteButton('Dismiss'); 

        $this->replaceKeyboard($newKeyboard);
    }
}

deleteKeyboard

The keyboard can be removed using the ->deleteKeyboard() method:

class CustomWebhookHandler extends WebhookHandler
{
    public function dismiss(){
        //...

        $this->deleteKeyboard();
    }
}
Suggest a change
Last updated 29 May 2026