codebuglab/letsbot-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

codebuglab/letsbot-php

Composer 安装命令:

composer require codebuglab/letsbot-php

包简介

Official PHP client for the LetsBot WhatsApp Business API. Seamlessly integrate WhatsApp messaging into your PHP & Laravel applications to automate customer communication, build chatbots, send notifications, and manage interactions.

README 文档

README

Tests codecov Total Downloads Latest Version on Packagist License

A comprehensive PHP package for integrating with the LetsBot WhatsApp API. This package provides a powerful, easy-to-use interface to leverage WhatsApp's extensive messaging capabilities in your PHP applications.

LetsBot transforms business messaging by providing access to WhatsApp's platform, used by 2 billion people worldwide with 60 billion daily messages. Our RESTful API enables you to connect your WhatsApp number to various third-party systems, programming languages, CMS, CRMs & CLI tools with minimal hassle and no complex dependencies.

Table of Contents

Requirements

  • PHP 7.4 or higher
  • Guzzle HTTP 7.0 or higher
  • A LetsBot account with API credentials

Installation

Laravel

If you're using Laravel, install the package via Composer:

composer require codebuglab/letsbot-php

After installation, publish the configuration file:

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

You can find the config file in config/letsbot.php.

PHP Native

For PHP native or OOP applications:

require 'vendor/autoload.php';

$lb = (new \LetsBot\Api\LetsBot);
$lb::$api_key = 'your_api_key'; // Set API key
$lb::$ssl_verify = false; // Set SSL verification (true/false, default is true)

$result = $lb->ChatList()->send();
echo json_encode($result);

Configuration

The configuration file contains essential settings for the API connection:

return [
  'api_key' => env('LETS_BOT_API_KEY', 'test'),
  'ssl_verify' => true,
];
  • api_key: Your API key generated from the LetsBot dashboard
  • ssl_verify: This option can disable SSL certificate verification if you're in development. Set to false to skip SSL certificate errors.

Basic Usage

The package provides an alias LetsBot\Api\LetsBot::class for easy use:

// In Laravel
use LetsBot;

return LetsBot::sessionStatus()->send();

// OR use the helper function
return lb()->sessionStatus()->send();

All methods follow a common pattern:

  1. Fluent interface:

    LetsBot::method()->param1(value)->param2(value)->send();
  2. Array parameter:

    LetsBot::method()->send([
      'param1' => value,
      'param2' => value
    ]);

Example: Sending a Text Message

// Fluent interface
LetsBot::message()
    ->phone('1234567890')
    ->body('Hello from LetsBot!')
    ->send();

API Features

The LetsBot PHP package provides comprehensive access to all WhatsApp Business API features:

  • Message Operations - Send texts, react to messages, reply to specific messages, mentions, and more
  • Media Messages - Share images, videos, documents, audio clips, and other media content
  • Interactive Messages - Create button messages, list messages, and other interactive content
  • Chat Operations - Manage chats, set status, archive conversations, and more
  • Group Operations - Create and manage groups, add/remove participants, and group settings
  • User Operations - Check presence, manage profiles, block/unblock users
  • Product Operations - Manage product catalogs and listings
  • Instance Operations - Manage your WhatsApp instance settings and status
  • Authentication - Handle QR codes and session management

Documentation

For detailed documentation on all available features and methods, please refer to the following guides:

Testing

The package includes comprehensive test coverage. To run tests:

composer test

To generate code coverage reports:

composer test-coverage

This will generate an HTML code coverage report in the coverage directory.

Compatibility

This package is tested with PHP 7.4, 8.0, 8.1, and 8.2 to ensure maximum compatibility across different environments and projects.

License

The MIT License (MIT). Please see License File for more information.

Support

Need assistance? Contact the LetsBot support team:

codebuglab/letsbot-php 适用场景与选型建议

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

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-06