cooperav/sms-aero-v2-laravel

Laravel-5中使用服务消息的包

1.0.0 2019-01-17 10:48 UTC

This package is not auto-updated.

Last update: 2024-09-21 13:37:14 UTC


README

SMS Aero for Laravel API 版本 2。

安装

步骤 #1

 composer require cooperav/sms-aero-v2-laravelL

步骤 #2

 阅读文档  https://smsaero.ru/description/api/

使用

添加依赖

 use CooperAV\SmsAero\SmsAero;

发送消息

    // Create SmsAero instance.
    $oSMSAero = new SmsAero('login','api_key');        
    // We can use it with config file f.e.
    // config('smsaero.login') and config('smsaero.api_key')
    
    // Set receiver's phone number.
    $phone_number = '111111111';
    
    // Set message content.
    $message = 'SMS Aero';
    
    // Sending channels.
    $type = 'DIRECT'; // In docuimentation describe other types.
    // To send message to another countries need use 'INTERNATIONAL' type.
    
    // Send message.
    $response = $oSMSAero->send($phone_number, $message, $type);
    
    // Default response data -> json. However we can get response in XML format.