Search by

vergil-lai / laravel-goeasy

vergil

GoEasy的Laravel广播驱动

Package info

github.com/vergil-lai/laravel-goeasy

pkg:composer/vergil-lai/laravel-goeasy

Statistics

Installs: 40

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v0.1.5 2024-08-08 10:05 UTC

This package is auto-updated.

Last update: 2026-09-10 03:41:32 UTC


README

laravel-goeasy

GoEasy的Laravel广播驱动

安装需求

  • PHP >= 8.0
  • Laravel >= 9.x | 10.x

安装

$ composer require vergil-lai/laravel-goeasy

Laravel使用

配置

在 config/broadcasting.php 的connections中添加以下配置:

'goeasy' => [
    'driver' => 'goeasy',
],

在configs/app.php的aliases中加入:

'GoEasy' => \VergilLai\LaravelGoeasy\Facades\GoEasy::class,

在GoEasy中创建应用,获取Common Key和Subscribe Key, 或者使用OTP的Rest key和Secret key

在.env文件加入:

BROADCAST_DRIVER=goeasy
GOEASY_HOST=https://rest-hz.goeasy.io 
## 或rest-singapore.goeasy.io
GOEASY_COMMON_KEY=your-common-key
GOEASY_SUBSCRIBE_KEY=your-subscribe-key

或

GOEASY_REST_KEY=your-rest-key
GOEASY_SECRET_KEY=your-secret-key

这样,就可以使用broadcast广播事件了。 详情请参阅Laravel文档。

获取OTP和AccessToken

使用GoEasyFacade方法:

GoEasy::otp();
GoEasy::pubsub()->makeAccessToken('your user id', 'channel name', $readable, $writeable),

客户端使用

请参阅GoEasy官方文档。

License

The MIT License (MIT). Please see License File for more information.