toshiyoung / laravel-smsru-channel
Sms.ru Notification Channel for laravel.
v1.0.0
2022-06-15 13:21 UTC
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.4
Requires (Dev)
- orchestra/testbench: ^7.5
- phpunit/phpunit: ^9.5
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