定制 bizbot/laravel-bizbot 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bizbot/laravel-bizbot

Composer 安装命令:

composer require bizbot/laravel-bizbot

包简介

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

README 文档

README

A clean, minimal Laravel package to send WhatsApp and SMS messages via the BizBot API.

Requirements

  • PHP >= 7.4
  • Laravel 9, 10, 11, or 12
  • GuzzleHttp 7

Installation

composer require bizbot/laravel-bizbot

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

Publish Config (optional)

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

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

# Ecare SMS API
BIZBOT_SMS_BASE_URL=https://send.ecaresms.com
BIZBOT_SMS_SEND_PATH=/api/v3/sms/send
BIZBOT_SMS_HTTP_SEND_PATH=/api/http/sms/send
BIZBOT_SMS_API_TOKEN=your_ecare_sms_api_token_here
BIZBOT_SMS_SENDER_ID=YourSenderId
BIZBOT_SMS_TYPE=plain

# 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

Resolve BizbotManager from the Laravel container:

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

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

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

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

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 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

The package automatically handles Bangladesh phone number formats:

Input Normalized
01711111111 8801711111111
1711111111 8801711111111
+8801711111111 8801711111111
8801711111111 8801711111111

SMS Provider

This package uses Ecare SMS API v3 for SMS delivery. It sends SMS using:

  • Endpoint: POST /api/v3/sms/send
  • Fallback endpoint (auto on 404): POST /api/http/sms/send
  • Auth header: Authorization: Bearer {BIZBOT_SMS_API_TOKEN}
  • Payload fields: recipient, sender_id, type, message

Package Structure

bizbot-laravel/
|-- src/
|   |-- BizbotServiceProvider.php   <- Laravel service provider
|   |-- BizbotManager.php           <- Main package interface
|   |-- Services/
|   |   |-- WhatsAppService.php     <- WhatsApp sender
|   |   `-- SmsService.php          <- SMS sender
|   `-- Clients/
|       `-- BizbotApiClient.php     <- Guzzle HTTP client
|-- config/
|   `-- bizbot.php                  <- Package config
|-- composer.json
`-- README.md

License

MIT (c) Mostafizur Rahman

bizbot/laravel-bizbot 适用场景与选型建议

bizbot/laravel-bizbot 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 12 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「sms」 「notification」 「laravel」 「whatsapp」 「bizbot」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 bizbot/laravel-bizbot 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 bizbot/laravel-bizbot 我们能提供哪些服务?
定制开发 / 二次开发

基于 bizbot/laravel-bizbot 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 22
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-12