toshiyoung/laravel-smsru-channel

Sms.ru Notification Channel for laravel.

v1.0.0 2022-06-15 13:21 UTC

This package is auto-updated.

Last update: 2025-06-11 11:19:07 UTC


README

Install

composer require toshiyoung/laravel-smsru-channel
php artisan vendor:publish --provider="TY\SmsRu\SmsRuServiceProvider"

Usage

You can use the channel in your via() method inside the notification:

use Illuminate\Notifications\Notification;
use TY\SmsRu\Messages\SmscRuMessage;
use TY\SmsRu\Channels\SmscRuChannel;

class SmsNotify extends Notification
{
    public function via($notifiable)
    {
        return [SmsRuChannel::class];
    }

    public function toSmsRu($notifiable)
    {
        return new SmsRuMessage("Привет! Это тестовое СМС.");
    }
}
Notification::route('sms_ru', '79001231234')->notify(new SmsNotify());

Testing

$ composer test