broadcastt/broadcastt-laravel-http
Composer 安装命令:
composer require broadcastt/broadcastt-laravel-http
包简介
Laravel library for Broadcastt HTTP API
关键字:
README 文档
README
Realtime web applications are the future. Broadcastt provides tools to help developers create realtime applications.
Laravel HTTP Library
Be aware that this library is still in beta and not reached the first MAJOR version.
Semantic Versioning 2.0.0
Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.
This library is compatible with Laravel 5.5+
This is an HTTP library for Laravel. If you are looking for a client library or a different server library please check out our list of libraries.
For tutorials and more in-depth documentation, visit the official site.
Documentation
First steps
Require this package, with Composer
composer require broadcastt/broadcastt-laravel-http
The Broadcastt service provider is registered automatically.
Broadcastt\Laravel\BroadcasttServiceProvider
If you want you can register the Broadcastt facade.
'Broadcastt' => Broadcastt\Laravel\Facades\Broadcastt::class
Configuration
To configure only the Broadcasting driver you have to modify config/broadcasting.php. You have to have an item in the connections array with its driver set to broadcastt.
'broadcastt' => [
'driver' => 'broadcastt',
'id' => env('BROADCASTER_APP_ID'),
'key' => env('BROADCASTER_APP_KEY'),
'secret' => env('BROADCASTER_APP_SECRET'),
'cluster' => env('BROADCASTER_APP_CLUSTER'),
],
The recommended way is to use environment variables or use .env to configure these data.
You can also use the PUSHER_APP_KEY, PUSHER_APP_SECRET, PUSHER_APP_ID and PUSHER_APP_CLUSTER environment variables respectively.
To configure other connection for the facade you should publish config/broadcastt.php.
php artisan vendor:publish --provider="Broadcastt\Laravel\BroadcasttServiceProvider"
In the published config/broadcasting.php file you can define many connections.
id (Integer)
The id of the application
key (String)
The key of the application
secret (String)
The secret of the application
cluster (String) Optional
The cluster of the application
Default value: eu
Additional options
useTLS (String)
Short way to change scheme to https and port to 443
debug (Boolean)
Turns on debugging for all requests
Default value: false
basePath (String)
The base of the path what the request will call
Default value: /apps/{AppId}
scheme (String)
E.g. http or https
Default value: http
host (String)
The host e.g. cluster.broadcasttapp.com. No trailing forward slash
Default value: eu.broadcasttapp.xyz If the cluster is not set during initialization
port (String)
The http port
Default value: 80
timeout (String)
The http timeout
Default value: 30
Usage of broadcaster
BroadcasttServiceProvider registers a driver for Broadcasting, so in config/broadcasting.php you can use broadcastt driver for broadcasting.
For example you can set BROADCAST_DRIVER environment variable to broadcastt.
Usage of facade
client($connection = null)
Returns a client instance
connection($connection = null)
Alias for client($connection = null)
trigger($channels, $name, $data, $socketId = null, $jsonEncoded = false)
Trigger an event by providing event name and payload.
Optionally provide a socket ID to exclude a client (most likely the sender).
triggerBatch($batch = [], $encoded = false)
Trigger multiple events at the same time.
get($path, $params = [])
GET arbitrary REST API resource using a synchronous http client.
All request signing is handled automatically.
Contributing
Everyone is welcome who would help to make this library "Harder, Better, Faster, Stronger".
broadcastt/broadcastt-laravel-http 适用场景与选型建议
broadcastt/broadcastt-laravel-http 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 601 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 04 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「rest」 「real-time」 「events」 「publish」 「messaging」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 broadcastt/broadcastt-laravel-http 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 broadcastt/broadcastt-laravel-http 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 broadcastt/broadcastt-laravel-http 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Talk is a Laravel based realtime messaging, chatting and conversation system. It helps to develop users messaging, chatting and conversations in easy way.
Библиотека для реализаций паттерна Pub/Sub
Wireless Cross-Component Communication
A powerful event calendar Tool for Laravel's Nova 5.
Boxalino Real Time User Experience (RTUX) Magento2 plugin
A PSR-7 compatible library for making CRUD API endpoints
统计信息
- 总下载量: 601
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-22