Download the PHP package cloudfort/tez without Composer

On this page you can find all versions of the php package cloudfort/tez. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tez

Tez — PHP SDK & Laravel Broadcaster

PHP Laravel

Tez is a PHP SDK and Laravel broadcaster for the Tez realtime broadcasting service. Publish events to channels, authenticate private and presence subscriptions, and integrate seamlessly with Laravel's broadcasting system.


Contents


Installation

Requirements: PHP 8.2+

For Laravel integration, the package auto-discovers its service provider. No manual registration needed.


Configuration

Environment Variables

Add these to your .env file:

Variable Description
TEZ_ENDPOINT The base URL of your Tez server (scheme + host only, no path)
TEZ_KEY Your API key (alphanumeric, plus ., _, :, -)
TEZ_SECRET Your base64-encoded secret (must decode to at least 32 bytes)

Publishing the Config

To customize the configuration file, publish it with:

This copies config/tez.php into your application's config/ directory.


Standalone PHP SDK

The SDK can be used without Laravel.

Creating a Client

Optional constructor parameters:

Parameter Type Default Purpose
$http GuzzleHttp\ClientInterface Internal Guzzle client Custom HTTP client
$clock Closure(): int time() Injectable clock (useful for testing)
$nonce Closure(): string bin2hex(random_bytes(16)) Injectable nonce generator

Publishing Events

To exclude a specific socket (e.g., the sender's own connection):

Constraints:

Creating Subscription Grants

Generate authentication tokens for private and presence channels:

Returns null for public channels (no authentication required).


Laravel Integration

Broadcast Driver Setup

In config/broadcasting.php, add a tez connection:

Then set the broadcast driver in your .env:

Broadcasting Events

Use Laravel's built-in broadcasting. Create an event that implements ShouldBroadcast:

Dispatch it as usual:

Channel Authentication

Tez handles authentication routes automatically through the TezBroadcaster. Register your channel authorization callbacks in routes/channels.php:

Presence Channels

For presence channels, return a non-empty array of user info from the channel callback:

The array is sent as user_info in the subscription grant. It must not exceed 1,024 bytes when JSON-encoded.


Channel Types

Type Prefix Auth Required Description
Public (none) No Any client can subscribe
Private private- Yes Server-authorizes each subscription
Presence presence- Yes Private + tracks connected users with metadata

Note: Encrypted channels (private-encrypted-*) are not supported.


Protocol Constants

Constant Value Description
Protocol::MAX_CHANNELS 16 Max channels per publish call
Protocol::MAX_BODY_BYTES 65,536 Max request body size
Protocol::MAX_USER_INFO_BYTES 1,024 Max user info payload for presence
Protocol::GRANT_TTL 60s Subscription grant time-to-live
Protocol::PUBLISH_PATH /v1/channels/events API publish endpoint

Error Handling

All server errors throw Cloudfort\Tez\Exceptions\TezException:

Validation errors throw InvalidArgumentException before any HTTP request is made.


Testing

Or directly:


License

The MIT License (MIT). See LICENSE for details.


All versions of tez with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.0
illuminate/broadcasting Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cloudfort/tez contains the following files

Loading the files please wait ...