Skip to content

vergil-lai/laravel-goeasy

Repository files navigation

laravel-goeasy

laravel-goeasy

GoEasyLaravel广播驱动

安装需求

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

安装

$ composer require vergil-lai/laravel-goeasy

Laravel使用

配置

config/broadcasting.phpconnections中添加以下配置:

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

configs/app.phpaliases中加入:

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

GoEasy中创建应用,获取Common KeySubscribe Key, 或者使用OTPRest keySecret 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文档

使用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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages