PHPackages                             bizbot/laravel-bizbot - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. bizbot/laravel-bizbot

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

bizbot/laravel-bizbot
=====================

Laravel package for BizBot – Send WhatsApp and SMS messages via the BizBot API.

v1.0.0(2mo ago)01MITPHPPHP ^7.4|^8.0

Since Mar 12Pushed 2mo agoCompare

[ Source](https://github.com/ecaresolutions/bizbot-laravel)[ Packagist](https://packagist.org/packages/bizbot/laravel-bizbot)[ RSS](/packages/bizbot-laravel-bizbot/feed)WikiDiscussions main Synced 1mo ago

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

BizBot Laravel Package
======================

[](#bizbot-laravel-package)

A clean, minimal Laravel package to send **WhatsApp** and **SMS** messages via the [BizBot](https://bizbot.one) API.

---

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- Laravel 9, 10, 11, or 12
- GuzzleHttp 7

---

Installation
------------

[](#installation)

```
composer require bizbot/laravel-bizbot
```

Laravel will auto-discover the `BizbotServiceProvider` - no manual registration needed.

### Publish Config (optional)

[](#publish-config-optional)

```
php artisan vendor:publish --tag=bizbot-config
```

---

Configuration
-------------

[](#configuration)

Add these variables to your `.env` file:

```
# BizBot WhatsApp API
BIZBOT_API_URL=https://api.bizbot.one
BIZBOT_API_KEY=your_bizbot_api_key_here
BIZBOT_CHANNEL_GUID=your_channel_guid_here

# SMS Provider: bulksmsbd or greenweb
BIZBOT_SMS_PROVIDER=bulksmsbd
BIZBOT_SMS_API_KEY=your_sms_api_key_here
BIZBOT_SMS_SENDER_ID=YourSenderId   # Required for BulkSMSBD only

# HTTP timeout in seconds (default: 15)
# Applied to both WhatsApp and SMS requests
BIZBOT_TIMEOUT=15

# Optional: SMS-only timeout in seconds (must be > 0)
BIZBOT_SMS_TIMEOUT=30
```

---

Usage
-----

[](#usage)

Resolve `BizbotManager` from the Laravel container:

```
$bizbot = app(\Bizbot\BizbotManager::class);
```

### Send WhatsApp Message

[](#send-whatsapp-message)

```
$result = $bizbot->sendWhatsApp('+8801711111111', 'Your order has been confirmed!');

if ($result['ok']) {
    // Message sent successfully
} else {
    // $result['error'] contains the reason
}
```

### Send SMS

[](#send-sms)

```
$result = $bizbot->sendSms('+8801711111111', 'Your OTP is 1234');

if ($result['ok']) {
    // SMS sent
} else {
    echo $result['error'];
}
```

### Deliver (WhatsApp with SMS Fallback)

[](#deliver-whatsapp-with-sms-fallback)

Tries WhatsApp first. If it fails, automatically falls back to SMS.

```
$result = $bizbot->deliver('+8801711111111', 'Your order #1234 is on the way!');

// $result = [
//   'whatsapp' => true|false,
//   'sms'      => true|false,
//   'success'  => true|false,
//   'errors'   => [],
// ]

if ($result['success']) {
    // At least one channel succeeded
}
```

---

Use in Controller
-----------------

[](#use-in-controller)

```
use Bizbot\BizbotManager;

class OrderController extends Controller
{
    public function __construct(protected BizbotManager $bizbot) {}

    public function notify(Order $order)
    {
        $phone   = $order->customer_phone;
        $message = "Hi {$order->customer_name}, your order #{$order->id} is confirmed!";

        $result = $this->bizbot->deliver($phone, $message);

        return response()->json($result);
    }
}
```

---

Phone Number Format
-------------------

[](#phone-number-format)

The package automatically handles Bangladesh phone number formats:

InputNormalized`01711111111``8801711111111``1711111111``8801711111111``+8801711111111``8801711111111``8801711111111``8801711111111`---

Supported SMS Providers
-----------------------

[](#supported-sms-providers)

Note: The package prefers HTTPS for SMS providers. If HTTPS cannot be established, it will retry once over HTTP.

ProviderKey constantNotesBulkSMSBD`bulksmsbd`Requires Sender IDGreenWeb`greenweb`Token-based, no Sender ID---

Package Structure
-----------------

[](#package-structure)

```
bizbot-laravel/
|-- src/
|   |-- BizbotServiceProvider.php
