Download the PHP package 7amoood/laravel-appsync-broadcaster without Composer

On this page you can find all versions of the php package 7amoood/laravel-appsync-broadcaster. 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 laravel-appsync-broadcaster

Laravel AppSync Broadcaster

A Laravel broadcasting driver for AWS AppSync that supports two publishing modes (direct, redis) and two transports (http, websocket) for real-time event delivery.

Features

Installation

Install the package via Composer:

The service provider is auto-discovered by Laravel.

Configuration

  1. Publish the configuration file:

  2. Set AppSync as your default broadcast driver and configure the core variables in .env:

  3. Optional tuning values from config/appsync.php:

Note: The AppSync connection is registered automatically. You do not need to manually add it to config/broadcasting.php.

Modes

Mode Description Worker required
direct Laravel publishes straight to AppSync using the configured transport No
redis Laravel publishes to Redis, and a worker relays the events to AppSync Yes

Transports

Transport Description Best for
http Sends one or more events using HTTP requests to AppSync Simple/default setup
websocket Uses a persistent WebSocket connection with batching Lower overhead / higher throughput

Supported combinations

APPSYNC_MODE APPSYNC_TRANSPORT Behavior
direct http Laravel sends events directly over HTTP
direct websocket Laravel sends events directly over WebSocket
redis http Laravel publishes to Redis, worker flushes to AppSync over HTTP
redis websocket Laravel publishes to Redis, worker relays over persistent WebSocket

Worker Usage (redis mode)

If you choose APPSYNC_MODE=redis, you must run the worker process:

Common overrides:

Production note: Run the worker under Supervisor or systemd in production.

Usage

Basic Broadcasting

Use Laravel's standard broadcasting flow:

Presence Channels

For presence channels, use Laravel's PresenceChannel as usual:

How publishing works

Channel Authentication

For private and presence channels, define authorization logic in routes/channels.php:

Frontend Integration

To subscribe to channels from your frontend application, you need to establish a WebSocket connection to AWS AppSync. Here's how to do it:

JavaScript/Node.js Example

Browser Example (ES6+)

Channel Name Format

Channels follow this format: {namespace}/{channel_type}-{channel_name}

Examples:

Authentication Flow

  1. Frontend sends channel name to your Laravel app's /broadcasting/auth endpoint
  2. Laravel validates the request and returns an AppSync API key
  3. Frontend uses the API key to establish WebSocket connection
  4. Frontend subscribes to specific channels using the authenticated connection

Event Structure

Events received from AppSync have this structure:

AWS AppSync Setup

  1. Create an AppSync Event API in your AWS Console
  2. Set up Cognito User Pool for authentication
  3. Create a Cognito App Client with client credentials flow enabled
  4. Attach Cognito to AppSync as auth method

Error Handling

The broadcaster includes built-in protections for both direct and worker-based delivery:

Logging

Important lifecycle and failure details are logged through Laravel's logging system, including:

Requirements

License

This package is open-sourced software licensed under the MIT license.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email the package maintainer instead of using the issue tracker.


All versions of laravel-appsync-broadcaster with dependencies

PHP Build Version
Package Version
Requires nesbot/carbon Version ^2.0|^3.0
php Version ^8.1
illuminate/broadcasting Version ^10.0|^11.0|^12.0
illuminate/cache Version ^10.0|^11.0|^12.0
illuminate/console Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/redis Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
react/event-loop Version ^1.5
ratchet/pawl Version ^0.4
clue/redis-react Version ^2.7
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 7amoood/laravel-appsync-broadcaster contains the following files

Loading the files please wait ...