Download the PHP package superbalist/laravel4-event-pubsub without Composer
On this page you can find all versions of the php package superbalist/laravel4-event-pubsub. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download superbalist/laravel4-event-pubsub
More information about superbalist/laravel4-event-pubsub
Files in superbalist/laravel4-event-pubsub
Package laravel4-event-pubsub
Short Description An event protocol and implementation over pub/sub for Laravel 4
License MIT
Informations about the package laravel4-event-pubsub
laravel4-event-pubsub
An event protocol and implementation over pub/sub for Laravel 4.
This package is a wrapper bridging php-event-pubsub into Laravel. It builds on top of the existing laravel4-pubsub package adding support for publishing and subscribing to events over pub/sub.
If you aren't familiar with the laravel4-pubsub
package, it's worth first taking a look at their documentation.
For Laravel 5 support, use the package https://github.com/Superbalist/laravel-event-pubsub
Installation
The package has a default configuration built-in.
To customize the configuration file, publish the package configuration using Artisan.
You can then edit the generated config at app/config/packages/superbalist/laravel4-event-pubsub/config.php
.
Register the service provider in app.php
Register the facade in app.php
Usage
Simple Events
A SimpleEvent
is an event which takes a name and optional attributes.
Topic Events
A TopicEvent
is an event which takes a topic, name, version and optional attributes.
Schema Events
A SchemaEvent
is an extension of the TopicEvent
and takes a schema and optional attributes. The topic, name and
version are derived from the schema.
The schema must be in the format (protocol)://(......)?/events/(topic)/(channel)/(version).json
Error Handling
The library supports error handlers for when event translation fails, listen expression fails and validation fails.
These are configurable as callables in the translate_fail_handler, listen_expr_fail_handler and validation_fail_handler config options.
The config contains default callables which will turn the callbacks into Laravel events.
You can listen for the following to hook into these:
All versions of laravel4-event-pubsub with dependencies
superbalist/php-event-pubsub Version ^4.0
superbalist/laravel4-psr6-cache-bridge Version 1.0.1
superbalist/json-guard-cached Version ^1.0
illuminate/support Version ^4.0
illuminate/config Version ^4.0
illuminate/events Version ^4.0
superbalist/laravel4-pubsub Version ^2.0.4|^3.0