astrotomic / notifynder-sender-nexmo
该软件包已被废弃,不再维护。未建议替代软件包。
Notifynder 软件包的 Nexmo 发送器。
1.1.0
2017-01-16 09:39 UTC
Requires
- php: >=5.5.0
- astrotomic/notifynder-abstract-sms: ^1.0
- fenos/notifynder: ^4.0
- illuminate/support: ~5.0
- nexmo/client: @beta
Requires (Dev)
- codeclimate/php-test-reporter: ^0.3.2
- laracasts/testdummy: ~2.0
- laravel/framework: ~5.0
- orchestra/testbench: ~3.0
- phpunit/phpunit: ~4.0|~5.0
This package is not auto-updated.
Last update: 2019-10-22 12:03:29 UTC
README
文档: Notifynder 文档
安装
步骤 1
composer require astrotomic/notifynder-sender-nexmo
步骤 2
将以下字符串添加到 config/app.php
提供者数组
Astrotomic\Notifynder\NotifynderSenderNexmoServiceProvider::class,
步骤 3
将以下数组添加到 config/notifynder.php
'senders' => [ 'nexmo' => [ 'key' => '', 'secret' => '', 'store' => false, // wether you want to also store the notifications in database ], ],
在您的 app/Providers/AppServiceProvider.php
中注册发送回调
<?php namespace App\Providers; use Illuminate\Support\ServiceProvider; use Astrotomic\Notifynder\Senders\NexmoSender; use Astrotomic\Notifynder\Senders\Messages\SmsMessage; use Fenos\Notifynder\Builder\Notification; class AppServiceProvider extends ServiceProvider { public function boot() { app('notifynder.sender')->setCallback(NexmoSender::class, function (SmsMessage $message, Notification $notification) { return $message ->from('0123456789') ->to('9876543210') ->text($notification->getText()); }); } }