Looking to hire Laravel developers? Try LaraJobs

laravel-smsru-channel maintained by toshiyoung

Description
Sms.ru Notification Channel for laravel.
Last update
2024/04/11 10:57 (dev-main)
License
Links
Downloads
42

Comments
comments powered by Disqus

Sms.ru notification channel for Laravel

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