2017 © Pedro Peláez
 

library laravel-sms

This is a SMS.

image

xutl/laravel-sms

This is a SMS.

  • Friday, July 6, 2018
  • by xutl
  • Repository
  • 0 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

laravel-sms

This is a sms expansion for the laravel, (*1)

License Latest Stable Version Total Downloads, (*2)

平台支持

环境需求

  • PHP >= 5.6

Installation

composer require xutl/laravel-sms

for Laravel

This service provider must be registered., (*3)

// config/app.php

'providers' => [
    '...',
    XuTL\Sms\SmsServiceProvider::class,
];

add the config file: config/sms.php, (*4)

add config, (*5)

use Overtrue\EasySms\Strategies\OrderStrategy;

return [
    // HTTP 请求的超时时间(秒)
    'timeout' => 5.0,

    /*
    |--------------------------------------------------------------------------
    | Default Setting
    |--------------------------------------------------------------------------
    |
    | This option defines the default sms gateway that gets used when writing
    | messages to the sms. The name specified in this option should match
    | one of the gateways defined in the "gateways" configuration array.
    |
    */
    'default' => [
        // 网关调用策略,默认:顺序调用
        'strategy' => OrderStrategy::class,

        /*
        |--------------------------------------------------------------------------
        | Default Gateways
        |--------------------------------------------------------------------------
        |
        | This option defines the default sms gateway that gets used when writing
        | messages to the sms. The name specified in this option should match
        | one of the gateways defined in the "gateways" configuration array.
        |
        */
        'gateways' => [

        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Log Gateways
    |--------------------------------------------------------------------------
    |
    | Here you may configure the sms gateways for your application.  This gives
    | you a variety of powerful log handlers / formatters to utilize.
    |
    | Available Drivers: "aliyun", "alidayu", "yunpian", "submail",
    |                    "errorlog", "luosimao", "yuntongxun", "huyi"
    |                    "juhe", "sendcloud", "baidu", "huaxin", "chuanglan"
    |                    "rongcloud", "tianyiwuxian", "twilio", "qcloud", "avatardata"
    |
    */
    'gateways' => [
        //Doc
        // https://github.com/overtrue/easy-sms
    ],
];

Use

try {
    $res = sms('13800138000', ['content'  => '您的验证码为: 6379','template' => '259734', 'data' => [6379]]);
    print_r($res);
} catch (InvalidArgumentException $e) {
    print_r($e->getMessage());
} catch (NoGatewayAvailableException $e) {
    print_r($e->getMessage());
}

The Versions

06/07 2018

dev-master

9999999-dev

This is a SMS.

  Sources   Download

MIT

The Requires

 

laravel sms

03/07 2018

1.0.0

1.0.0.0

This is a SMS.

  Sources   Download

MIT

The Requires

 

laravel sms