msgowl/msgowl-laravel-notification-channel
最新稳定版本:v1.0.6
Composer 安装命令:
composer require msgowl/msgowl-laravel-notification-channel
包简介
MsgOwl notification channel for laravel
README 文档
README
Installation
You can install the package via composer:
composer require msgowl/msgowl-laravel-notification-channel
Setting up your MsgOwl Credentials
Add the environment variables to your config/services.php:
// config/services.php ... 'msgowl' => [ 'sender_id' => env('MSGOWL_SENDER_ID'), 'api_key' => env('MSGOWL_API_KEY'), 'recipients' => env('MSGOWL_RECIPIENTS'), ], ...
Add your MsgOwl API Key, Default SenderID and default recipients to your .env:
// .env ... MSGOWL_SENDER_ID= MSGOWL_API_KEY= MSGOWL_RECIPIENTS= ], ...
Usage
Now you can use the channel in your via() method inside the notification:
use MsgOwl\MsgowlLaravelNotificationChannel\MsgOwlChannel; use MsgOwl\MsgowlLaravelNotificationChannel\MsgOwlMessage; use Illuminate\Notifications\Notification; class UserApproved extends Notification { public function via($notifiable) { return [MsgOwlChannel::class]; } public function toMsgOwl($notifiable) { return (new MsgOwlMessage("You are approved by the system")); } }
you can add recipients (single value or array)
return (new MsgOwlMessage("You are approved by the system"))->setRecipients($recipients);
Or You can add a routeNotificationForMsgOwl method to your Notifiable model to return the phone number(s):
public function routeNotificationForMsgOwl() : string { return $this->mobile; }
Reference
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-26