csgt / notification-channel-conceptomovil
Concepto Movil 通知通道。
v6.07
2023-08-18 17:05 UTC
Requires
- php: ^8.0.0
Requires (Dev)
- mockery/mockery: ^0.9.5
- phpunit/phpunit: 4.*
README
此包使您能够轻松使用 Laravel 5.4 发送 [Conceptomovil 通知]。
内容
安装
您可以通过 composer 安装此包
composer require csgt/notification-channel-conceptomovil
您必须安装服务提供者
// config/app.php 'providers' => [ ... NotificationChannels\Conceptomovil\ConceptomovilProvider::class, ],
设置您的 Conceptomovil 账户
将您的 Conceptomovil Account SID、认证令牌和 From Number(可选)添加到 config/services.php
// config/services.php ... 'conceptomovil' => [ 'url' => env('CONCEPTO_MOVIL_URL'), 'token' => env('CONCEPTO_MOVIL_TOKEN'), 'apiKey' => env('CONCEPTO_MOVIL_KEY'), 'country' => env('CONCEPTO_MOVIL_COUNTRY'), 'dial' => env('CONCEPTO_MOVIL_DIAL'), 'tag' => env('CONCEPTO_MOVIL_TAG'), ], ...
使用方法
现在您可以在通知内的 via() 方法中使用该通道
use NotificationChannels\Conceptomovil\ConceptomovilChannel; use NotificationChannels\Conceptomovil\ConceptomovilMessage; use Illuminate\Notifications\Notification; class AccountApproved extends Notification { public function via($notifiable) { return [ConceptomovilChannel::class]; } public function toConceptomovil($notifiable) { return (new ConceptomovilMessage()) ->content("Your {$notifiable->service} account was approved!"); } }
为了使您的通知知道您要发送/呼叫的电话号码,该通道将在可通知模型中查找 celular 属性。如果您想覆盖此行为,将 routeNotificationForConceptomovil 方法添加到您的可通知模型中。
public function routeNotificationForConceptomovil() { return $this->mobile; }
可用的消息方法
ConceptomovilSmsMessage
from(''):接受一个电话作为通知发送者。content(''):接受一个字符串值作为通知正文。
变更日志
请参阅变更日志了解最近更改的详细信息。
安全
如果您发现任何安全问题,请通过电子邮件 jgalindo@cs.com.gt 联系我们,而不是使用问题跟踪器。
贡献
有关详细信息,请参阅贡献指南。
致谢
许可证
MIT 许可证(MIT)。有关更多信息,请参阅许可证文件。