Download the PHP package maslauskas/event-store without Composer

On this page you can find all versions of the php package maslauskas/event-store. 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 event-store

event-store

Simple EventStore implementation package for Laravel using MySQL.

Build Status Latest Stable Version Total Downloads License

Installation

To start using this package, install it with composer:

Publishing config and migrations:

This package uses Laravel's package auto-discovery feature, so there is no need to modify your config/app.php file.

Configuration

Event Store logs are saved to your main database by default, but it is recommended to use a dedicated MySQL database for it. Once you create the database, make sure to set Event Store to use it:

First, add a dedicated connection to your config/database.php file:

Next, add required environment variables to your .env file:

It is recommended to create a separate user for event store database, and remove UPDATE, DELETE, DROP permissions, to make sure your event store is append-only.

Next, run the migration to create default event store table:

Usage

To start logging your events, append this line to your code where you wish the event to be logged:

Or using the eventstore helper function, which is just a wrapper for the facade:

the add() method accepts four arguments:

Sometimes, certain events occur much more frequently than others, e.g. user_created and user_logged_in. To help with query performance, you can separate certain events to their dedicated tables by changing the streams array in config/eventstore.php file:

This will automatically create a dedicated user_login_stream table in your event store database when you try to add user_logged_in event. All events that are not defined in this array will be saved in the default event store table.

Extra methods

query()

Returns Illuminate\Database\Eloquent\Builder instance so you can perform any query on event store tables.

get()

Gets all events from the default event store table. Returns a collection.

get($event_name)

Gets all events of specific type from event store table. Automatically determines which table to search in. Returns a collection.

stream($stream_name)

Sets dedicated table and returns Illuminate\Database\Eloquent\Builder instance so you can perform any query on event store tables.

Exception handling

By default, EventStore suppresses any exceptions that occur during add() method call. You can disable this by changing throw_exceptions setting in config/eventstore.php:

Testing

Run the tests with


All versions of event-store with dependencies

PHP Build Version
Package Version
No informations.
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 maslauskas/event-store contains the following files

Loading the files please wait ....