Download the PHP package thefreshuk/pubsub-laravel without Composer

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

PubSub for Laravel

This package integrates Laravel projects with Publish/Subscribe providers, using a content-based pub/sub model.

Supported Providers

Install

via composer:

Configuration

By default, this package looks for the following env variables:

You may override this by running the following in your project:

With regards to PUBSUB_ALLOW_HTTP, this configures the library to allow HTTP endpoints. Right now, only the signature cert URL is checked as part of SNS message verification. Setting this to true requires the use of a forked package (AWS SNS message validator doesn't allow HTTP at all out of the box). To set this up, add the following to your composer.json file:

And then run:

Usage

Subscriptions

There are two ways to subscribe to a topic:

1. Extend SubscriptionServiceProvider:

This allows you to specify a mapping of 'types' to routes and controllers.

Types are our way of distinguishing between messages. Combined with content-based filtering, this provides a system that feels like a multi-topic system without the proliferation of topics in traditional SNS.

2. Inject Topic

The Topic class is available for use however you wish. By providing a ClientInterface object and a topic name, as a string, you can use multiple topics with this library.

Laravel will inject the default Topic into relevant type-hinted constructors. Since the library has been designed for use with a content-based Pub\Sub system, there must be a 'default' topic or else this will fail.

Publishing

The Topic class provides a publish method that accepts a message. It's as simple as calling this method for a given topic.

Messages

Messages are sent by publishers and received by subscribers. Every message has a 'type' and 'content':

The Pub\Sub system (preferably) filters based on the type property.

There are two ways to use Messages:

1. Separate classes

You can use the following command to generate message classes:

This generates a message class in <app_dir>/PubSub/Messages. You can instantiate and publish these messages.

2. DynamicMessage

You can also use the TheFresh\PubSub\Messages\DynamicMessage class. This accepts $type and $content constructor arguments. All messages received through subscriptions are DynamicMessages.


All versions of pubsub-laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
aws/aws-sdk-php-laravel Version ^3.1
aws/aws-php-sns-message-validator Version 2.0.1
guzzlehttp/guzzle Version ^7.0.1
symfony/console Version ^6.2
illuminate/console Version ^10.9
illuminate/support Version ^10.9
illuminate/filesystem Version ^10.9
illuminate/routing Version ^10.9
illuminate/collections Version ^10.9
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 thefreshuk/pubsub-laravel contains the following files

Loading the files please wait ....