sagordev/powersms-gateway 问题修复 & 功能扩展

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

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

sagordev/powersms-gateway

最新稳定版本:v1.0.0

Composer 安装命令:

composer require sagordev/powersms-gateway

包简介

A php package for BanglaPhone Power SMS

README 文档

README

The PowerSMS Gateway PHP Package allows you to easily send bulk SMS messages using the Power SMS service provided by Banglaphone Limited. This package is compatible with both Laravel and raw PHP applications, making it versatile for various use cases.

Installation

You can install this package via Composer:

composer require sagordev/powersms-gateway

Laravel Integration

For Laravel integration, follow these additional steps:

Publish the package configuration file:

 php artisan vendor:publish --provider="Sagordev\PowersmsGateway\Providers\PowerSmsGatewayServiceProvider"

This will publish the configuration file to config/powersms.php

Add your Power SMS API credentials and configure other settings in the config/powersms.php file:

return [
    'user_id' => 'YOUR_USER_ID',
    'password' => 'YOUR_PASSWORD',
    'url' => '' // You can keep it blank
];

Usage

Sending SMS

use Sagordev\PowersmsGateway\Facades\PowerSms;

PowerSms::message('This is a test SMS', '01234567890')->send();
// You can also send list of numbers (ex: ['01234567890', '01234567891'])

Sending Same SMS to multiple recipients

PowerSms::message('This is test SMS')
        ->to(['01234567890', '01234567891'])
        ->send();

Add your number(s) in cc to get a carbon copy of message

PowerSms::message('I am SMS with carbon copy to developer')
        ->to(['01234567890', '01234567891'])
        ->cc(['01234567892'])
        ->send();

Another way to send single SMS to multiple recipients

PowerSms::send([
    'message' => 'Hey, This is another SMS',
    'to' => ['01234567890', '01234567891'],
]);

Send Multiple messages to multiple different recipients

PowerSms::send([
      [
          'message' => 'Dear Customer, Your invitation code is #3310',
          'to' => ['01234567890', '01234567891'],
      ],
      [
          'message' => 'Dear Customer, Your invitation code is #0950',
          'to' => '01234567892',
      ]
]);

In your other PHP project

use Sagordev\PowersmsGateway\PowerSms;

$config = [
    'user_id' => 'YOUR_USER_ID',
    'password' => 'YOUR_PASSWORD',
    'url' => '' // You can keep it blank
];

$sms = new PowerSms($config);
$sms->message('Hello', '01234567890')->send();

// Example 2
$sms->message('I am SMS with carbon copy to developer')
        ->to(['01234567890', '01234567891'])
        ->cc(['01234567892'])
        ->send();
// Please look at the previous examples for more fun

Support and Issues

If you encounter any issues or have questions about using this package, please feel free to create an issue on the GitHub repository. I am here to help!

License

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

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固