定制 tekkenking/swissecho 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

tekkenking/swissecho

最新稳定版本:0.7.1

Composer 安装命令:

composer require tekkenking/swissecho

包简介

A multigateway laravel SMS notification channel package

README 文档

README

Swissecho is a Laravel SMS notification channel package that provides a convenient way to send SMS messages through various gateways. This package is designed to be flexible, allowing you to customize the message content, recipient, sender, and gateway.

Installation

To install the Swissecho package, simply require it via Composer:

composer require tekkenking/swissecho

Laravel Version Compatibility

For Laravel 5.5 and above, the package should be automatically discovered. For Laravel versions below 5.5, you may need to add the service provider to your config/app.php file:

'providers' => [
    // ...
    Tekkenking\Swissecho\SwissechoServiceProvider::class,
],

Basic Usage

The following are different ways to use the Swissecho package:

General Usage

    Swissecho::route('sms', function($ms) {
        return $ms->to('XXXXXXXXXXXX, XXXXXXXXXXXX ')
            ->content('Wonders shall never end')
            ->line('Hello world');
            //->gateway('routemobile') //optional
            //->sender('SimbooBiz'); //optional
    })
    ->to('XXXXXXXXXXXX') //optional
    ->sender('Smart') //optional
    ->gateway('termii') //optional
    ->go();

Use Case 1 (SMS)

    swissecho()->route('sms', function($ms) {
        return $ms->to('XXXXXXXXXXXX, XXXXXXXXXXXX ')
            ->content('Wonders shall never end')
            ->line('Hello world');
            //->gateway('routemobile') //optional
            //->sender('SimbooBiz'); //optional
    })
    ->to('XXXXXXXXXXXX') //optional
    ->sender('Smart') //optional
    ->gateway('termii') //optional
    ->go();

Use Case 2

    swissecho()->quick('XXXXXXXXXXXX', "My name is bola");

Use Case 3 (Slack)

    swissecho()->message("Hello world")
    ->to('XXXXXXXXXXXX')
    //->sender('Raimi')
    //->gateway('termii')
    ->route('slack')
    ->go();

Use Case 4 (Vonage)

    swissecho()->gateway('vonage')->quick('XXXXXXXXXXXX', "My name is bola");

Use Case 5 (Termii)

    $sw = swissecho();
    //$sw->mockNotifiable($user);
    $sw->gateway('termii');
    $sw->to = "XXXXXXXXXXXX";
    $sw->sender = "AXIX";
    $sw->message = "The world is a beauty place created by GOD";
    $sw->go();

Feel free to customize the examples based on your specific use case and requirements.

License

This package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

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