contextmapp / laravel-pushwoosh
Laravel集成Pushwoosh的包
v0.3.1
2018-10-02 05:48 UTC
Requires
- php: ^7.0
- gomoob/php-pushwoosh: ^1.0
- illuminate/notifications: 5.3 - 5.6
- illuminate/support: 5.1 - 5.6
Requires (Dev)
- php-coveralls/php-coveralls: ^2.1
- phpunit/phpunit: ~6.0
Suggests
- laravel-notification-channels/backport: Required when using Laravel 5.1 or 5.2, drop-in replacement for 'illuminate/notifications'.
This package is auto-updated.
Last update: 2024-09-29 05:20:47 UTC
README
这是一个简单的包装器,用于将Gomoob的php-pushwoosh包与Laravel框架集成。
安装
使用Composer将此包作为依赖项拉取。
composer require contextmapp/laravel-pushwoosh
如果你使用Laravel 5.4或更低版本,或者已禁用包发现,请将提供者添加到config/app.php
中的providers
数组中
Contextmapp\Pushwoosh\PushwooshServiceProvider::class
如果你想使用Pushwoosh
外观,你还应将正确的别名添加到aliases
数组中
'Pushwoosh' => Contextmapp\Pushwoosh\Facades\Pushwoosh::class
配置
你应该发布此包提供的配置文件以设置Pushwoosh详细信息。
php artisan vendor:publish --provider=Contextmapp\Pushwoosh\PushwooshServiceProvider
此命令将配置文件复制到config/pushwoosh.php
。
确保您已设置默认应用的api_token
和application_id
。
用法
您可以使用包装器直接与Pushwoosh SDK交互,或者将Pushwoosh支持添加到您的Laravel通知。
Laravel通知
如果您使用Laravel的通知系统,可以将'pushwoosh'
添加到通知的via()
响应中。通道名称也作为类常量在Contextmapp\Pushwoosh\PushwooshChannel
类上可用。期望通知类实现Contextmapp\Pushwoosh\Contracts\PushwooshNotification
协议。您的可通知类应实现Contextmapp\Pushwoosh\Contracts\PushwooshNotifiable
协议。