medo172192/webcloud 问题修复 & 功能扩展

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

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

medo172192/webcloud

Composer 安装命令:

composer require medo172192/webcloud

包简介

whatsapp controls

README 文档

README

A library used with the Laravel framework to enable you to send WhatsApp messages as well as deal with bulk messages and get WhatsApp qrcode and login using OTP and other things.

Installation

Install Webcloud with composer

  composer require medo172192/webcloud

Support

Laravel env

  WHATSAPP_DOMAIN="https://app.needbots.com/"

Usage/Examples

use Medo172192\Webcloud\WebCloud;

class Examples
{

  /*
  * Create Webcloud new instance
  * @return WebCloud
  */
  public function connect() 
  {
    $connect = WebCloud::accessToken("token")->setInstance("instanceId");
    return $connect;
  }


  /*
  * send whatsapp message
  * @return Void
  */
  public function sendMessage() 
  {
    $response = $this->connect()->to("phone")->message("template")->send();
    if( $response->status == 'success' ){
      // The message was sent successfuly
    }else{
      \Log::error($response->message);
    }//@endif
    
  }


  /*
  * send whatsapp bulk message
  * @return Void
  */
  public function sendBulkMessage() 
  {

    foreach ($contacts as $contact) {
      $response = $this->connect()->to("contact")->message("template")->send();

      if( $response->status == 'success' ){
      // The message was sent successfuly
      }else{
        \Log::error($response->message);
      }//@endif

    } //@endforeach
    
  }//@endfunction



  
  /*
  * send whatsapp message and media
  * @return Void
  */
  public function sendMessage() 
  {
    $response = $this->connect()->to("phone")   ->message("template")->media("path")->send();
    if( $response->status == 'success' ){
      // The message was sent successfuly
    }else{
      \Log::error($response->message);
    }//@endif
    
  }



 /*
  * send whatsapp bulk message and attachments
  * @return Void
  */
  public function sendBulkMessage() 
  {

    foreach ($contacts as $contact) {
      $response = $this->connect()->to("contact")->message("template")->media("path")->send();

      if( $response->status == 'success' ){
      // The message was sent successfuly
      }else{
        \Log::error($response->message);
      }//@endif

    } //@endforeach
    
  }//@endfunction



}

🛠 Skills

PHP , LARAVEL

License

MIT

Authors

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固