定制 bjthecod3r/laravel-smartsms 二次开发

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

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

bjthecod3r/laravel-smartsms

Composer 安装命令:

composer require bjthecod3r/laravel-smartsms

包简介

A Laravel package for smartsmssolutions

README 文档

README

Latest Version on Packagist Total Downloads

A Laravel package for smartsms [https://smartsmssolutions.com]

Installation

Via Composer

$ composer require bjthecod3r/laravel-smartsms

If you do not run Laravel 5.5 (or higher), then add the service provider in config/app.php:

BJTheCod3r\SmartSms\SmartSmsServiceProvider::class

For lower versions of Laravel, you can also register facade like so in config/app.php:

    'aliases' => [
        ...
        'SmartSms' => BJTheCod3r\SmartSms\Facades\SmartSms::class,
        ...
    ]

Configuration

You can publish the configuration file using this command:

php artisan vendor:publish --provider="BJTheCod3r\SmartSms\SmartSmsServiceProvider"

A configuration file named smartsms.php will be generated and placed in the config directory. You can play around with the default configuration.

Usage

Open your .env file and add this variables. Change to what works for you.

SMARTSMS_SENDER_ID=cod3r
SMARTSMS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SMARTSMS_TYPE=0
SMARTSMS_ROUTE=3
SMARTSMS_SIMSERVER_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx

In your class or applicable file, just include the SmartSms class like so:

use BJTheCod3r\SmartSms\SmartSms;

In your function you can then use this

$smartSms = new SmartSms();

// This would send sms to the specified number. `sender` is optional. When `sender` is not set, it picks the default.
return $smartSms->sendSms("080xxxxxxxx", "Testing sms", "sender")->send();
// You can also specify multiple phone numbers separated with comas.
return $smartSms->sendSms("080xxxxxxxx, 080xxxxxxxx", "Testing sms")->send();
//You can change default route, type. You can add schedule, dlr, ref_id
return $smartSms->sendSms("080xxxxxxxx", "Testing sms")->route(0)->send();

A successful response should look like this

{
    "success": true,
    "response": {
        "code": "1000",
        "successful": "234802XXXXXXXX",
        "basic_successful": "234802XXXXXXXX",
        "corp_successful": "",
        "simserver_successful": "",
        "simserver_shared": "",
        "simserver_failed": "",
        "simserver_distribution": [],
        "failed": "",
        "flooding": "",
        "insufficient_unit": "",
        "invalid": "",
        "all_numbers": "234802XXXXXXXX",
        "nondnd_numbers": "234802XXXXXXXX",
        "dnd_numbers": "",
        "units_used": 1.5,
        "units_calculated": 1.5,
        "basic_units": 0,
        "corp_units": 0,
        "units_before": "37.71",
        "units_after": "36.21",
        "sms_pages": 1,
        "simhost": "",
        "message_id": "msg-20210409-dmbhW8E331WoJAdDaIzJj4IvElUMa7kBWXYfTVF",
        "ref_id": null,
        "comment": "Completed Successfully"
    }
}
//Check balance with
return $smartSms->checkBalance();

You may also use facade

SmartSms::sendSms("080xxxxxxxx", "Some message here.")->send();

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: license
  • 更新时间: 2021-04-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固