timedoor/whatsapp-otp 问题修复 & 功能扩展

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

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

timedoor/whatsapp-otp

最新稳定版本:v1.0.0

Composer 安装命令:

composer require timedoor/whatsapp-otp

包简介

Whatsapp OTP package for Laravel

README 文档

README

This package is used to send WhatsApp OTP notification using WhatsApp Cloud API on Laravel.

Installation

Install package via composer

composer require timedoor/whatsapp-otp

Install config and notification file for WhatsApp OTP

php artisan whatsapp-otp:install

Set Up WhatsApp Cloud API

This package requires a Meta developer account and a Meta developer app to start sending message with WhatsApp. To set up Meta developer app follow the instructions as described in WhatsApp Cloud API documentation.

Create WhatsApp Template

WhatsApp API only allows you to start conversation by sending a template message. In order to send an OTP notfication, you must make a WhatsApp template first. You can take a look at the WhatsApp Template documentation page for more details.

For multi language template, you can create separate templates for different languages with the same template name.

Configure WhatsApp Cloud API

Copy the access token and phone number ID from Whatsapp app dashboard.

Then place your access token, phone number ID, template name, and template language in the .env file as below.

WHATSAPP_ACCESS_TOKEN=
WHATSAPP_PHONE_ID=
WHATSAPP_TEMPLATE_NAME=
WHATSAPP_TEMPLATE_LANG=

The config settings of WhatsApp API can be seen on config/whatsapp.php file.

Usage

This package comes with notification class WhatsappOtpNotification that is stored in app/Notifications folder.

To send OTP notification you can use notify method provided by Notifiable trait like the example below.

$notification = new WhatsappOtpNotification();
$event->otp->notify($notification);

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固