rubium/redsms

Package for send sms via redsms.ru. Based on official PHP class https://github.com/redsms/api-samples-php
1,059 1
Install
composer require rubium/redsms
Latest Version:v0.2
Laravel:6 – 9
License:MIT
Last Updated:Aug 12, 2022
Links: GitHub  ·  Packagist
Maintainer: rubium

Laravel redsms.ru notifications

Software License Travis Total Downloads

Install

composer require rubium/redsms

php artisan vendor:publish --provider="Rubium\RedSms\RedSmsServiceProvider"

Usage

Package for send sms via redsms.ru. Based on official PHP class https://github.com/redsms/api-samples-php. This is package provide Channel and base Notification.

Create file config/redsms.php with content: (For details please read documentation https://redsms.ru/integration/api/):

<?php

return [
    //Login
    'login' => env('REDSMS_LOGIN', ''),
    //API Key
    'api_key' => env('REDSMS_API_KEY', ''),

    'api_url' => env('REDSMS_API_URL', null),

    'from' => env('REDSMS_PHONE', ''), //

    'sms_sender_name' => env('REDSMS_SMS_SENDER_NAME', 'REDSMS.RU'), //

    'viber_sender_name' => env('REDSMS_VIBER_SENDER_NAME', 'REDSMS.RU'), //
];

Examples:

notify method (notifiable should have phone property):

use Rubium\RedSms\Notifications\RedSms;
...
$user->notify(new RedSms('test'));

In Notification:

  public function via($notifiable)
  {
        return [RedSmsChannel::class];
  }   

  public function toSms($notifiable)
  {
        return [
              'phone' => $this->phone,
              'message' => $this->message
        ];
  }

Facade:

RedSms::send('89881234567', 'test'); // return bool

Testing

Run the tests with:

vendor/bin/phpunit

Credits

Security

If you discover any security-related issues, please email hello@rubium.ru instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

Related Packages

mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

21,859,365 1,981
kyslik/column-sortable

Package for handling column sorting in Laravel 6.x

6,401,765 647
mews/captcha

Laravel 5/6/7/8/9/10/11/12 Captcha Package

6,209,423 2,587
ajthinking/archetype

Programmatically edit PHP and Laravel files.

4,566,573 271

Version History

Version Released Laravel License
v0.2 ^6.0|^7.0|^8.0|^9.0 MIT
v0.1 ^6.0|^7.0|^8.0|^9.0 MIT