uithread/mgov-sms

mgov的SMS网关包

1.0 2019-11-22 13:02 UTC

This package is auto-updated.

Last update: 2024-09-23 19:48:01 UTC


README

Latest Stable Version License: MIT

准备使用!

关于

Laravel mGovSMS集成包适用于您的Laravel或Lumen应用程序。它具有默认的短信日志表。Laravel mGovSMS易于配置和自定义。支持Laravel 5.5、5.6、5.7、5.8和6.0+

功能

要求

Laravel安装说明

  1. 在终端中从项目根目录运行
    composer require uithread/mgov-sms
  1. 注册包 注册包,将ServiceProvider添加到config/app.php中
    Uithread\MgovSMS\MgovSMSServiceProvider::class,
Add the Facade in config/app.php
    'MgovSMS' => Uithread\MgovSMS\Facades\MgovSMSFacade::class,
  1. 通过在项目根目录运行以下命令发布包的配置文件和迁移文件
    php artisan vendor:publish --provider="Uithread\MgovSMS\MgovSMSServiceProvider"  
  1. 运行迁移以将表添加到短信日志
    php artisan migrate
  1. 要发送短信,请使用以下方法
      use MgovSMS;
     
      MgovSMS::sendSingleSMS('MESSAGE Hello World!', '99########');
      MgovSMS::sendOtpSMS('MESSAGE Hello World!', '99########');
      MgovSMS::sendBulkSMS('MESSAGE Hello World!', '99########,98########');
      MgovSMS::sendSingleUnicode('MESSAGE Hello World!', '99########');
      MgovSMS::sendUnicodeOtpSMS('MESSAGE Hello World!', '99########');
      MgovSMS::sendBulkUnicode('MESSAGE Hello World!', '99########,98########');
      

配置

Laravel mGovSMS配置在/config/mgov-sms.php中。

配置文件

以下是可用的mgov-sms.php文件变量

    'userName' => 'USER NAME',//username of the department
    'senderId' => 'SENDER ID',//password of the department
    'password' => 'PASSWORD',//senderid of the deparment
    'secureKey' => 'Generated Secure Key',// Secure key generated at https://services.mgov.gov.in/

文件树

├── LICENSE
├── README.md
├── composer.json
└── src
    ├── MgovSMS.php
    ├── MgovSMSServiceProvider.php
    ├── config
    │   └── mgov-sms.php
    ├── Facades
    │   └── MgovSMSFacade.php
    ├── migrations
    │   └── 2019_08_20_083308_create_t_sms_logs_table.php
    └── Models
        └── TSmsLog.php

许可证

Laravel-logger遵循MIT许可证。享受吧!