umuttaymaz/laravel-notification-verimor

此包已被放弃,不再维护。未建议替代包。

Verimor SMS for Laravel Notifications

1.0.1 2018-02-28 22:19 UTC

This package is not auto-updated.

Last update: 2020-01-24 17:39:15 UTC


README

Software License Build Status StyleCI Total Downloads

此包使得使用Laravel 5.3+通过VerimorSMS发送通知变得简单。

内容

安装

您可以通过composer安装此包

composer require umuttaymaz/laravel-notification-verimor

然后您必须安装服务提供者

// config/app.php
'providers' => [
    ...
    UmutTaymaz\VerimorSMS\VerimorSMSServiceProvider::class,
],

设置VerimorSMS服务

将您的Verimor用户名、密码和默认发送者名称添加到您的.env

VERIMOR_USERNAME=username
VERIMOR_PASSWORD=apiPassword
VERIMOR_HEADER=verifiedHeader

使用

您可以在通知内的via()方法中使用此通道

use Illuminate\Notifications\Notification;
use NotificationChannels\SmscRu\SmscRuMessage;
use NotificationChannels\SmscRu\SmscRuChannel;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [VerimorSMSChannel::class];
    }

    public function toVerimor($notifiable)
    {
        return VerimorSMSMessage::create('This is notification message');
    }
}

在您的可通知模型中,请确保包含一个返回电话号码的routeNotificationForVerimor()方法。

public function routeNotificationForVerimor()
{
    return $this->phone;
}

变更日志

请查看CHANGELOG以获取更多最近更改的信息。

测试

$ composer test

安全

如果您发现任何与安全相关的问题,请通过电子邮件umut@kreator.com.tr联系,而不是使用问题跟踪器。

贡献

请查看CONTRIBUTING以获取详细信息。

感谢

许可

MIT许可(MIT)。请参阅许可文件以获取更多信息。