Download the PHP package medz/laravel-jpush-notification-channel without Composer

On this page you can find all versions of the php package medz/laravel-jpush-notification-channel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-jpush-notification-channel

极光推送在 Laravel 通知的支持

我们在开发针对国内运营的时候进行需要使用过程的几家推送,极光推送则是其中之一。这个包就可以让你方便的在你构件的 Laravel 应用中进行极光推送的使用。

前提

安装驱动需要以下条件:

安装

在你的 Laravel 应用目录执行 Composer 进行安装:

包中依赖了匹配的 jpush/jpush 依赖版本为 ^3.6,你已经依赖了更低版本的不兼容版本包,使用的时候要小心了!

配置

config/services.php 中进行如下配置:

然后在 .env 文件中进行配置:

使用

我们已用户为例,这里使用 laravel/laravel 创建的默认应用模型位置。

数据模型

在用户模型中进行配置,创建一个 routeNotificationForJpush 方法在模型上:

这里我们返回一个 Medz\Laravel\Notifications\JPush\Sender 实例,可以使用构造参数快速配置,如同上面一样,也可以使用链式调用进行配置。链式调用的 API 如下:

setAudience 方法或者构造参数中的 audience 设置参考:推送目标文档。

通知类

一般我们写通知大概都是通过 php artisan make:notification 进行创建的,存放在 app/Notifications/ 目录下,假设我们现在有一个评论通知类 CommentNotification.php 我们仅需在里面增加下面的代码:

toJpush 方法需要返回一个 Medz\Laravel\Notifications\JPush\Message 对象实例!

完成上面的配置后,就可以推送了,记得在 via 方法中返回 jpush 这个值哈,例如:

使用案例

License

这个包采用 MIT License 开源。


All versions of laravel-jpush-notification-channel with dependencies

PHP Build Version
Package Version
Requires jpush/jpush Version ^3.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package medz/laravel-jpush-notification-channel contains the following files

Loading the files please wait ....