loopeer / easypush
A package for push messages
Installs: 34
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 12
Forks: 1
Open Issues: 0
pkg:composer/loopeer/easypush
Requires
- php: >=5.5.9
 
This package is not auto-updated.
Last update: 2025-10-22 05:42:21 UTC
README
Installation
composer require loopeer/easypush
Configuration
- 注册 
ServiceProvider和Facade: 
Loopeer\EasyPush\Providers\EasyPushProvider::class, 'EasyPush' => \Loopeer\EasyPush\Facades\EasyPushFacade::class,
- 发布配置文件
 
php artisan vendor:publish
发布后请修改app/config/easypush.php 中对应的配置项
Usage
- 对单个用户推送消息
 
app('easypush')->pushToSingle($push, $title, $content, $custom); //或 EasyPush::pushToSingle($push, $title, $content, $custom);
- 对多个用户推送消息
 
app('easypush')->pushToList($pushes, $title, $content, $custom); //或 EasyPush::pushToList($pushes, $title, $content, $custom);
- 全局推送消息
 
app('easypush')->pushToAll($title, $content, $custom); //或 EasyPush::pushToAll($title, $content, $custom);
Parameters
- push: 推送参数,格式为对象或数组
- channel: 所属渠道(0-个推, 1-小米)
 - client_id: 推送渠道用户id
 - platform: 设备(ios, android)
 
 - title: 推送标题
 - content: 推送内容
 - custom: 自定义推送内容