axolotesource/laravel-whatsapp-api 问题修复 & 功能扩展

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

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

axolotesource/laravel-whatsapp-api

最新稳定版本:1.0.0

Composer 安装命令:

composer require axolotesource/laravel-whatsapp-api

包简介

This Laravel package facilitates sending WhatsApp messages seamlessly within your application. With easy integration, it empowers developers to incorporate WhatsApp messaging functionality, enhancing user engagement and communication in a straightforward manner.

README 文档

README

INSTALL

composer require axolotesource/laravel-whatsapp-api

To publish the configuration file, run the following command:

php artisan vendor:publish

When prompted to select the provider, choose Axolotesource\LaravelWhatsappApi\LaravelWhatsappApiServiceProvider.

WhatsAppMessages

Examples

templete(string $to, string $templateName = null): Template

This method allows you to send a template-type message (this is the first message that should be sent to the client). For the second parameter, it can be null, and if so, it retrieves the value from config('laravel-whatsapp-api.default_initial_template');.

$whatsappMessage = WhatsAppMessages::templete($phoneNumber)
    ->language('es_MX')
    ->addComponents([
        BodyComponent::create([
            Params::text('This is a test message')
        ]),
        ButtonComponent::create([
            Params::button('yes')
        ]),
        ButtonComponent::create([
            Params::button('no')
        ]),
        ButtonComponent::create(
            [
                Params::button("history/login?folio=123ABC")
            ],
            ButtonComponent::SUB_TYPE_URL
        ),
        ButtonComponent::create([
            Params::button('never')
        ])
    ]);
interactiveButtons(string $to): InteractiveButtons
WhatsAppMessages::interactiveButtons($phoneNumber)
    ->setHeaderImage(
        'https://url.com/test.jpg'
    )
    ->addButton('Button 1', 1)
    ->addButton('Button 2', 2)
    ->addButton('Button 3', 3)
    ->body('This is te body message')
    ->send();

Coming song more documentation....

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MTI
  • 更新时间: 2023-11-21