ibrain / ib4stream
Ibrain Laravel SDK
1.1
2020-02-12 21:07 UTC
Requires
- guzzlehttp/guzzle: ~6.0
This package is not auto-updated.
Last update: 2024-09-30 01:16:48 UTC
README
基于
ibrain/ib4stream
包的 iBrain/Ib4stream 客户端 SDK。
使用方法
composer require ibrain/ib4stream
- 在
config/app.php
中的providers
下注册服务提供者Ibrain\Ib4stream\Providers\Ib4steamServiceProvider::class
- 注册外观
Ibrain\Ib4stream\Facades\Ib4streamFacade
- 发布 ib4stream.js
php artisan vendor:publish --tag=ib4stream.js
- 发布 ib4stream.php
php artisan vendor:publish --tag=ib4stream.php
Ib4stream::publish("mychannel");
<script src="js/ib4stream.js" type="text/javascript"></script>
window.options = {
url: "{{ config('ib4stream.wss_url') }}",
appId: "{{ config('ib4stream.app_id') }}"
}
Ib4stream(options, (os) => {
os.subscribe("mychannel", (data) => {
// Action Here
});
});