Realtime web applications are the future. Broadcastt provides tools to help developers create realtime applications.
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.
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
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.
The id of the application
The key of the application
The secret of the application
The cluster of the application
Default value: eu
Short way to change scheme
to https
and port
to 443
Turns on debugging for all requests
Default value: false
The base of the path what the request will call
Default value: /apps/{AppId}
E.g. http or https
Default value: http
The host e.g. cluster.broadcasttapp.com. No trailing forward slash
Default value: eu.broadcasttapp.xyz
If the cluster is not set during initialization
The http port
Default value: 80
The http timeout
Default value: 30
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
.
Returns a client instance
Alias for client($connection = null)
Trigger an event by providing event name and payload.
Optionally provide a socket ID to exclude a client (most likely the sender).
Trigger multiple events at the same time.
GET arbitrary REST API resource using a synchronous http client.
All request signing is handled automatically.
Everyone is welcome who would help to make this library "Harder, Better, Faster, Stronger".