承接 sevenspan/laravel-value-first 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

sevenspan/laravel-value-first

Composer 安装命令:

composer require sevenspan/laravel-value-first

包简介

It uses ValueFirst API to send whatsapp messages.

README 文档

README

It uses ValueFirst API to send whatsapp messages.

Installation

You can install the package via composer:

composer require sevenspan/laravel-value-first

You can publish the config file with:

php artisan vendor:publish --provider="SevenSpan\ValueFirst\Providers\ValueFirstServiceProvider" --tag="config"

This is the contents of the published config file:

return [

    /*
    |--------------------------------------------------------------------------
    | ValueFirst Whatsapp API URI
    |--------------------------------------------------------------------------
    |
    | The ValueFirst Whatsapp Message API URI.
    |
    */

    'api_uri' => env('VALUEFIRST_API_URI',''),

    /*
    |--------------------------------------------------------------------------
    | From Number
    |--------------------------------------------------------------------------
    |
    | The Phone number registered with ValueFirst that your SMS will come from
    |
    */

    'from' => env('VALUEFIRST_FROM',''),

    /*
    |--------------------------------------------------------------------------
    | Username
    |--------------------------------------------------------------------------
    |
    | Your ValueFirst Username
    |
    */

    'username' =>  env('VALUEFIRST_USERNAME',''),

    /*
    |--------------------------------------------------------------------------
    | Password
    |--------------------------------------------------------------------------
    |
    | Your ValueFirst Password
    |
    */

    'password' =>  env('VALUEFIRST_PASSWORD',''),
];

Usage

For sending whatsapp text messages

use ValueFirst;

$to ='9111111111'; // Phone number with country code where we want to send message(Required)
$message ='Hello'; // Message that we want to send(Required)
$tag = 'Whatsapp Message';  //Tag if you want to assign (Optional)

// Without passing tag
$response=ValueFirst::sendMessage($to,$message);

// With passing tag
$response=ValueFirst::sendMessage($to,$message,$tag);

For sending whatsApp text messages using template ID

use ValueFirst;

$to ='9111111111'; // Phone number with country code where we want to send message(Required)
$templateId = "123"; //Approved template ID by ValueFirst
$data = []; // Array of data to replace template data with dynamic one
$tag = 'Whatsapp Message';  //Tag if you want to assign (Optional)



// Without passing tag
$response=ValueFirst::sendTemplateMessage($to,$templateId,$data);

// With passing tag
$response=ValueFirst::sendTemplateMessage($to,$templateId,$data,$tag);

Note : While sending whatsapp message with template ID, array of data should be in sequence of template dynamic value.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固