rouxtaccess/laravel-smsportal
最新稳定版本:3.0.2
Composer 安装命令:
composer require rouxtaccess/laravel-smsportal
包简介
SMS Portal Notification Channel for laravel
README 文档
README
SMS Portal Notification Channel for laravel
SMS Notifications
Version Support
Laravel 5.5+, 6, 7
Installation
Send SMS notifications in Laravel powered by SMSPortal. Before you can send notifications via SMSPortal, you need to install the neolikotsi/laravel-smsportal Composer package:
composer require neolikotsi/laravel-smsportal
The package will automatically register itself.
You can publish the migration with:
php artisan vendor:publish --provider="Illuminate\Notifications\SMSPortalServiceProvider"
This is the contents of the published config file:
return [ 'client_id' => env('SMS_PORTAL_CLIENT_ID'), 'secret' => env('SMS_PORTAL_SECRET'), 'base_uri' => env('SMS_PORTAL_URL', 'https://rest.smsportal.com/v1/'), 'delivery_enabled' => env('SMS_PORTAL_DELIVERY_ENABLED', true), ];
Formatting SMS Notifications
If a notification supports being sent as an SMS, you should define a toSmsPortal method on the notification class. This method will receive a $notifiable entity and should return a Illuminate\Notifications\Messages\SMSPortalMessage instance:
/** * Get the SMSPortal / SMS representation of the notification. * * @param mixed $notifiable * @return SMSPortalMessage */ public function toSmsPortal($notifiable) { return (new SMSPortalMessage) ->content('Your SMS message content'); }
Adding as Delivery Channel
Add the channel smsportal to the notification delivery channels.
/** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return ['mail', 'smsportal']; }
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 1.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-09