Download the PHP package supplycart/laravel-eventsauce without Composer

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

Build Status Code Style Latest Stable Version Total Downloads

Laravel EventSauce

👋 This project is currently looking for a new maintainer.

This library allows you to easily integrate EventSauce with your Laravel application. It takes out the tedious work of having to set up your own message dispatcher and provides an easy API to set up consumers, and more. It also comes with a range of scaffolding console commands to easily generate the boilerplate needed to get started with an Event Sourced application.

⚠️ While already usable, this library is currently still a work in progress. More documentation and features will be added over time. We appreciate pull requests that help extend and improve this project.

Requirements

Installation

Before installing a new package it's always a good idea to clear your config cache:

You can install the library through Composer. This will also install the main EventSauce library.

Configuration

You can publish the config file with the following command:

Migrations

The default domain_messages table will be loaded in through the library's service provider and migrated with:

You can also publish it and modify it as you see fit with the following command:

Default Connection

The default database connection can be modified by setting the EVENTSAUCE_CONNECTION env variable:

Default Table

The default table name for your domain messages can be set with the EVENTSAUCE_TABLE env variable:

Scaffolding

Laravel EventSauce comes with some commands that you can use to scaffold objects and files which you'll need to build your Event Sourced app. These commands take out the tedious work of writing these yourself and instead let you focus on actually writing your domain logic.

Generating Aggregate Roots

Laravel EventSauce can generate aggregate roots and its related files for you. By using the make:aggregate-root command, you can generate the following objects and files:

To generate these files for a "Registration" process, run the following command:

This will scaffold the following files:

These are all the files you need to get started with an https://github.com/EventSaucePHP/LaravelEventSauce.

Generating Consumers

Laravel EventSauce can also generate consumers for you. For example, run the make:consumer command to generate a SendEmailConfirmation process manager:

This will create a class at App\Domain\SendEmailConfirmation where you can now define handle{EventName} methods to handle events.

Generating Commands & Events

EventSauce can generate commands and events for you so you don't need to write these yourself. First, define a commands_and_events.yml file which contains your definitions:

Then define the input and output output file in the AggregateRootRepository:

And register the AggregateRootRepository in your eventsauce.php config file:

You can now generate commands and events for all repositories that you've added by running the following command:

For more info on creating events and commands with EventSauce, as well as how to define different types, see the EventSauce documentation.

Usage

Aggregate Roots

More docs coming soon...

Aggregate Root Repositories

More docs coming soon...

Queue Property

You can instruct Laravel to queue all consumers onto a specific queue by setting the $queue property:

This will force all consumers who have the ShouldQueue contract implemented to make use of the registrations queue instead of the default queue defined in your queue.php config file.

Consumers

Consumers are classes that react to events fired from your aggregate roots. There's two types of consumers: projections and process managers. Projections update read models (think updating data in databases, updating reports,...) while process managers handle one-time tasks (think sending emails, triggering builds, ...). For more information on how to use them, check out EventSauce's Reacting to Events documentation.

A SendEmailConfirmation process manager, for example, can look like this:

Within this consumer you always define methods following the handle{EventName} specification.

Registering Consumers

After writing your consumer, you can register them with the $consumers property on the related AggregateRootRepository:

The sequence of adding consumers shouldn't matter as the data handling within these consumers should always be treated as independent from each other.

Queueing Consumers

By default, consumers are handled synchronous. To queue a consumer you should implement the ShouldQueue contract on your consumer class.

By doing so, we'll instruct Laravel to queue the consumer and let the data handling be done at a later point in time. This is useful to delay long-running data processing.

Changelog

Check out the CHANGELOG in this repository for all the recent changes.

Maintainers

This project is currently looking for a new maintainer.

Acknowledgments

Thanks to Frank De Jonge for building EventSauce. Thanks to Freek Van der Herten and Spatie's Laravel EventSauce library for inspiration to some of the features in this package.

License

Laravel EventSauce is open-sourced software licensed under the MIT license.


All versions of laravel-eventsauce with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
eventsauce/eventsauce Version ^1.0
illuminate/bus Version ^8.0|^9.0|^10.0|^11.0
illuminate/container Version ^8.0|^9.0|^10.0|^11.0
illuminate/queue Version ^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
ramsey/uuid Version ^3.8|^4.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 supplycart/laravel-eventsauce contains the following files

Loading the files please wait ....