PHPackages                             zerexei/botman-drivers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. zerexei/botman-drivers

ActiveLibrary[API Development](/categories/api)

zerexei/botman-drivers
======================

Custom BotMan driver collection for Messenger, WhatsApp Cloud API, Viber, and a local web playground.

0.1.0(1mo ago)422[6 issues](https://github.com/zerexei/botman-drivers/issues)MITPHPPHP ^8.2

Since Jul 8Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/zerexei/botman-drivers)[ Packagist](https://packagist.org/packages/zerexei/botman-drivers)[ RSS](/packages/zerexei-botman-drivers/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Zerexei BotMan Drivers
======================

[](#zerexei-botman-drivers)

**Custom BotMan 2.x drivers for Messenger, WhatsApp Cloud API, and Viber**

[![Latest Version on Packagist](https://camo.githubusercontent.com/e4fc1dd5a648f08e66d487631cb2abcf7f5ec1ae2a7362f89eecc080709379a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a6572657865692f626f746d616e2d647269766572732e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/e4fc1dd5a648f08e66d487631cb2abcf7f5ec1ae2a7362f89eecc080709379a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a6572657865692f626f746d616e2d647269766572732e7376673f7374796c653d666c61742d737175617265)[![Total Downloads](https://camo.githubusercontent.com/d41636cec7e8daae7b6d5187a645bda43b74b4f22cda0966c892d164cb7ac1fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a6572657865692f626f746d616e2d647269766572732e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/d41636cec7e8daae7b6d5187a645bda43b74b4f22cda0966c892d164cb7ac1fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a6572657865692f626f746d616e2d647269766572732e7376673f7374796c653d666c61742d737175617265)[![PHP 8.2+](https://camo.githubusercontent.com/e165e38e31a9c99f58cf8c034b981119d63b6ecea34f71784c0740feb10fe457/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e322d3737376262342e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/e165e38e31a9c99f58cf8c034b981119d63b6ecea34f71784c0740feb10fe457/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e322d3737376262342e7376673f7374796c653d666c61742d737175617265)[![MIT License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)[![BotMan 2.x](https://camo.githubusercontent.com/219c84a0616d2ac34d0ee0ae99a7b9220eef078d33718b657ae3b2a37f6d122f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f426f744d616e2d322e782d3030623936623f7374796c653d666c61742d737175617265266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/219c84a0616d2ac34d0ee0ae99a7b9220eef078d33718b657ae3b2a37f6d122f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f426f744d616e2d322e782d3030623936623f7374796c653d666c61742d737175617265266c6f676f436f6c6f723d7768697465)[![PSR-4 Compliant](https://camo.githubusercontent.com/c82d054d22362479f1e362e5678985919020c31533e941fdd21749e7b743f64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5053522d2d342d636f6d706c69616e742d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/c82d054d22362479f1e362e5678985919020c31533e941fdd21749e7b743f64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5053522d2d342d636f6d706c69616e742d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)

---

Overview
--------

[](#overview)

A collection of custom [BotMan](https://botman.io) drivers that connect your PHP chatbot to multiple messaging platforms. Each driver follows the BotMan `HttpDriver` contract and comes with typed message template builders.

Also includes a **local web playground** (frosted-glass UI + PHP dev server) so you can develop and test your bot without a tunnel or real webhook.

```
Drivers/
├── Messenger/          # Facebook Messenger Platform
│   └── MessageTemplates/  # ButtonTemplate, GenericTemplate, QuickReply, Image, Text
├── WhatsApp/           # WhatsApp Cloud API
│   └── MessageTemplates/  # ButtonTemplate (interactive list), Image, Text
├── Viber/              # Viber Bot API
│   └── MessageTemplates/  # ButtonTemplate, GenericTemplate, Image, Text
├── Web/                # Local playground (botman/driver-web)
├── Template/           # Scaffold — copy this to build your own driver
├── BaseController.php  # Abstract webhook controller base
├── BotConversation.php # Example conversation class
└── Config.php          # Thin getenv() wrapper

```

---

Getting Started
---------------

[](#getting-started)

### 1. Clone and install

[](#1-clone-and-install)

```
git clone https://github.com/zerexei/botman-drivers.git
cd botman-drivers
composer install
```

### 2. Configure credentials

[](#2-configure-credentials)

```
cp .env.example .env
```

Open `.env` and fill in the tokens for the platforms you use:

VariablePlatformWhere to get it`MESSENGER_ACCESS_TOKEN`MessengerMeta App → Messenger → Access Tokens`WHATSAPP_ACCESS_TOKEN`WhatsAppMeta App → WhatsApp → API Setup`WHATSAPP_VERIFY_TOKEN`WhatsAppA secret string you register in the Meta webhook dashboard`VIBER_ACCESS_TOKEN`Viber[partners.viber.com](https://partners.viber.com/)`VIBER_SENDER_NAME`ViberDisplay name shown to users (e.g. `Support Bot`)`VIBER_SENDER_AVATAR`ViberPublic URL of your bot's avatar (optional)### 3. Run the local playground

[](#3-run-the-local-playground)

```
php -S localhost:8000
```

Open `http://localhost:8000`. The frosted-glass chat UI talks to the Web driver. No credentials or tunnel needed.

---

Integration
-----------

[](#integration)

### Embed in an existing PHP project

[](#embed-in-an-existing-php-project)

Copy the `Drivers/` folder into your project root and add the PSR-4 mapping to your `composer.json`:

```
"autoload": {
    "psr-4": {
        "Drivers\\": "Drivers/"
    }
}
```

```
composer dump-autoload
```

### Register drivers

[](#register-drivers)

Call `DriverManager::loadDriver()` before creating the BotMan instance:

```
use BotMan\BotMan\Drivers\DriverManager;
use BotMan\BotMan\BotManFactory;
use BotMan\BotMan\Cache\LaravelCache;
use Drivers\Messenger\MessengerDriver;
use Drivers\WhatsApp\WhatsAppDriver;
use Drivers\Viber\ViberDriver;

DriverManager::loadDriver(MessengerDriver::class);
DriverManager::loadDriver(WhatsAppDriver::class);
DriverManager::loadDriver(ViberDriver::class);

$botman = BotManFactory::create($config, new LaravelCache());
```

### Customize a controller

[](#customize-a-controller)

Each controller exposes a `registerHandlers(BotMan $bot)` method for your bot logic. Extend the provided controller instead of editing it directly so you keep upstream bug fixes:

```
namespace App\Bot;

use BotMan\BotMan\BotMan;
use Drivers\WhatsApp\WhatsAppController as BaseController;
use App\Bot\Conversations\SupportConversation;

class WhatsAppController extends BaseController
{
    protected function registerHandlers(BotMan $botman): void
    {
        $botman->hears('hello', fn($bot) => $bot->reply('Hi! How can I help?'));
        $botman->hears('support', fn($bot) => $bot->startConversation(new SupportConversation));
        $botman->fallback(fn($bot) => $bot->reply("Sorry, I didn't understand that."));
    }
}
```

Then register your controller in `server.php`:

```
'whatsApp' => App\Bot\WhatsAppController::class,
```

---

Message Templates
-----------------

[](#message-templates)

Typed builder classes for platform-specific message formats — no raw arrays needed.

### Messenger

[](#messenger)

Button Template```
use Drivers\Messenger\MessageTemplates\ButtonTemplate;
use Drivers\Messenger\MessageTemplates\Button;

$bot->reply(
    ButtonTemplate::create('What would you like to do?')
        ->addButton(Button::create('Visit Docs', 'web_url',  'https://botman.io'))
        ->addButton(Button::create('Get Help',   'postback', 'HELP_PAYLOAD'))
);
```

Quick Replies```
use Drivers\Messenger\MessageTemplates\QuickReplyTemplate;
use Drivers\Messenger\MessageTemplates\QuickReplyButton;

$bot->reply(
    QuickReplyTemplate::create('Are you sure?')
        ->addButton(QuickReplyButton::create('Yes ✅', 'text', 'YES'))
        ->addButton(QuickReplyButton::create('No ❌',  'text', 'NO'))
);
```

Generic (Carousel) Template```
use Drivers\Messenger\MessageTemplates\GenericTemplate;
use Drivers\Messenger\MessageTemplates\Element;
use Drivers\Messenger\MessageTemplates\Button;

$bot->reply(
    GenericTemplate::create()
        ->addElement(
            Element::create('Product Name', 'Short description', 'https://example.com/img.jpg')
                ->addButton(Button::create('View', 'web_url', 'https://example.com'))
                ->addButton(Button::create('Buy',  'postback', 'BUY_123'))
        )
);
```

Image```
use Drivers\Messenger\MessageTemplates\ImageTemplate;

$bot->reply(ImageTemplate::create('https://example.com/photo.jpg'));
```

---

### WhatsApp

[](#whatsapp)

Text```
use Drivers\WhatsApp\MessageTemplates\TextTemplate;

$bot->reply(TextTemplate::create('Hello from WhatsApp! 👋'));
```

Image```
use Drivers\WhatsApp\MessageTemplates\ImageTemplate;

$bot->reply(ImageTemplate::create('https://example.com/photo.jpg'));
```

Interactive List (Button Template)```
use Drivers\WhatsApp\MessageTemplates\ButtonTemplate;
use Drivers\WhatsApp\MessageTemplates\Button;

// Second argument sets the list button label (default: 'Options')
$bot->reply(
    ButtonTemplate::create('What do you need help with?', 'Choose')
        ->addButton(Button::create('1', 'Technical Support'))
        ->addButton(Button::create('2', 'Billing'))
        ->addButton(Button::create('3', 'General Inquiry'))
);
```

---

### Viber

[](#viber)

Text```
use Drivers\Viber\MessageTemplates\TextTemplate;

$bot->reply(TextTemplate::create('Hello from Viber! 👋'));
```

Image```
use Drivers\Viber\MessageTemplates\ImageTemplate;

$bot->reply(ImageTemplate::create('https://example.com/photo.jpg'));
```

Button Keyboard```
use Drivers\Viber\MessageTemplates\ButtonTemplate;
use Drivers\Viber\MessageTemplates\Button;

$bot->reply(
    ButtonTemplate::create('Pick an action:')
        ->addButton(Button::create('Say Hello'))
        ->addButton(Button::create('Visit Site', 'open-url', 'https://example.com'))
);
```

Rich Media (Carousel)```
use Drivers\Viber\MessageTemplates\GenericTemplate;
use Drivers\Viber\MessageTemplates\Element;
use Drivers\Viber\MessageTemplates\Button;

$bot->reply(
    GenericTemplate::create()
        ->addElement(
            Element::create('Card Title', 'Card subtitle', 'https://example.com/img.jpg')
                ->addButton(Button::create('Open', 'open-url', 'https://example.com'))
        )
);
```

---

Building a New Driver
---------------------

[](#building-a-new-driver)

Copy `Drivers/Template/` and rename the files and namespace to match your platform:

```
cp -r Drivers/Template Drivers/MyPlatform
```

The scaffold includes three files:

FileWhat to implement`TemplateDriver.php``buildPayload`, `matchesRequest`, `getMessages`, `buildServicePayload`, `sendPayload`, `isConfigured``TemplateController.php`Self-contained webhook entry point (intentionally does not extend `BaseController`)`MessageTemplates/TextTemplate.php`Starting point for message builders---

Supported Platforms
-------------------

[](#supported-platforms)

PlatformDriverAPI Reference🌐 Web (playground)`botman/driver-web`—💬 Messenger`Drivers\Messenger\MessengerDriver`[Messenger Platform](https://developers.facebook.com/docs/messenger-platform)📱 WhatsApp`Drivers\WhatsApp\WhatsAppDriver`[WhatsApp Cloud API](https://developers.facebook.com/docs/whatsapp/cloud-api)📲 Viber`Drivers\Viber\ViberDriver`[Viber Bot API](https://developers.viber.com/docs/api/rest-bot-api)---

Contributing
------------

[](#contributing)

Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

Security
--------

[](#security)

To report a security vulnerability, contact: 📧 **Angelo Arcillas** —

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance70

Regular maintenance activity

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/070bc396a58fbf36ba7a06bc98bf973867765f4f7e44ec093ff2fb3c63753101?d=identicon)[zerexei](/maintainers/zerexei)

---

Top Contributors

[![zerexei](https://avatars.githubusercontent.com/u/69749146?v=4)](https://github.com/zerexei "zerexei (41 commits)")

---

Tags

botmanbotman-driverinstagram-botmessenger-botviber-botwebsite-botwhatsapp-bot

### Embed Badge

![Health badge](/badges/zerexei-botman-drivers/health.svg)

```
[![Health](https://phpackages.com/badges/zerexei-botman-drivers/health.svg)](https://phpackages.com/packages/zerexei-botman-drivers)
```

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

818355.4k3](/packages/defstudio-telegraph)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[flat3/lodata

OData v4.01 Producer for Laravel

100357.6k](/packages/flat3-lodata)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1349.3k1](/packages/jasara-php-amzn-selling-partner-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
