megoxv/zeromsg 问题修复 & 功能扩展

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

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

megoxv/zeromsg

最新稳定版本:v1.0.0

Composer 安装命令:

composer require megoxv/zeromsg

包简介

ZeroMsg fluent API for Whatsapp diverse message types integration.

README 文档

README

Latest Stable Version PHP Version Require License Downloads

The ZeroMsg Laravel package provides a fluent interface to interact with the ZeroMsg API, supporting various message types such as text, image, voice, media, list messages, link previews, and locations.

Installation

Step 1: Require the Package

You can install the package via Composer. Run the following command in your terminal:

composer require megoxv/zeromsg

Step 2: Configuration

Add your ZeroMsg API key and Device ID to your .env file:

ZEROMSG_API_KEY=your_api_key_here
ZEROMSG_DEVICE_ID=your_device_id_here

Usage

To use the ZeroMsg package, include the ZeroMsg facade in your Laravel project.

Sending a Text Message

use Megoxv\ZeroMsg\Facades\ZeroMsg;

ZeroMsg::create()
    ->message('Hello, this is a test message')
    ->to('34676010101')
    ->send();

Sending an Image

use Megoxv\ZeroMsg\Facades\ZeroMsg;

ZeroMsg::create()
    ->message('Check out this image!')
    ->image('https://example.com/image.jpg', 'image.jpg')
    ->to('34676010101')
    ->send();

Sending a Voice Message

use Megoxv\ZeroMsg\Facades\ZeroMsg;

ZeroMsg::create()
    ->voice('https://example.com/voice.mp3')
    ->to('34676010101')
    ->send();

Sending a Media Message

use Megoxv\ZeroMsg\Facades\ZeroMsg;

ZeroMsg::create()
    ->message('Check out this media file!')
    ->media('https://example.com/media.mp4', 'media.mp4')
    ->to('34676010101')
    ->send();

Sending a List Message

use Megoxv\ZeroMsg\Facades\ZeroMsg;

ZeroMsg::create()
    ->message('Check out this list!')
    ->listMessage(
        'Options',
        'Select',
        [
            [
                'title' => 'Section 1',
                'value' => 'option1',
                'description' => 'First option'
            ],
            [
                'title' => 'Section 2',
                'value' => 'option2',
                'description' => 'Second option'
            ]
        ]
    )
    ->to('34676010101')
    ->send();

Sending a Link Preview

use Megoxv\ZeroMsg\Facades\ZeroMsg;

ZeroMsg::create()
    ->message('Check out this link!')
    ->linkPreview('https://zeromsg.com')
    ->to('34676010101')
    ->send();

Sending a Location

use Megoxv\ZeroMsg\Facades\ZeroMsg;

ZeroMsg::create()
    ->location('37.7749', '-122.4194', 'San Francisco', 'California, USA')
    ->to('34676010101')
    ->send();

Publish Assets

you can publish config file by use this command

php artisan vendor:publish --tag="zeromsg-config"

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固