1. Go to this page and download the library: Download wypeng/laravel-getui library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wypeng / laravel-getui example snippets
// config/app.php
'providers' => [
//...
ShaoZeMing\GeTui\GeTuiServiceProvider::class, //This is default in laravel 5.5
],
// config/app.php
'aliases' => [
'GeTui' => ShaoZeMing\GeTui\Facade\GeTui::class, //This is default in laravel 5.5
],
use GeTui;
//针对单个或者多个用户推送
GeTui::push($deviceId, $data,true) //Using default default_client 推送给默认的客户端
GeTui::toClient('CLIENT NAME')->push($deviceId, $data) // CLIENT NAME is key name of `development` or `production` configuration. //自定义发送的客户端
// 针对整个app所有人推送
GeTui::pushToApp($data,true) ////Using default default_client
GeTui::toClient('CLIENT NAME')->pushToApp($data) // GATEWAY NAME is key name of `development` or `production` configuration.