Download the PHP package ahmedosamir732/eventbus-php without Composer
On this page you can find all versions of the php package ahmedosamir732/eventbus-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ahmedosamir732/eventbus-php
More information about ahmedosamir732/eventbus-php
Files in ahmedosamir732/eventbus-php
Package eventbus-php
Short Description A Laravel package for publishing and consuming integration events over RabbitMQ with built-in retry, DLQ, and multi-tenant support.
License MIT
Informations about the package eventbus-php
EventBus PHP
A Laravel package for publishing and consuming integration events over RabbitMQ. Supports multi-tenant contexts, automatic retry with exponential backoff, dead-letter queues, and graceful shutdown.
Requirements
- PHP 8.3+
- Laravel 11 or 12
- RabbitMQ 3.7+
Installation
Publish the config:
Configuration
Add these to your .env:
The driver defaults to rabbitmq when RABBITMQ_HOST is set, otherwise falls back to null (no-op).
Publishing Events
Implement ContextProviderInterface to supply tenant, workspace, actor, and correlation info from the current request:
Register it in config/eventbus.php:
Then publish events:
Consuming Events
Implement EventHandlerInterface and tag it in a service provider:
Register the handler:
Configure consumers in config/eventbus.php:
Start the consumer:
DLQ Replay
Replay dead-letter messages:
Event Envelope
Every event carries a standardized envelope:
| Field | Type | Description |
|---|---|---|
event_id |
string (UUID) | Unique event identifier |
event_type |
string | Routing key (e.g. user.created) |
version |
string | Schema version |
source |
string | Publishing service name |
tenant_id |
int|string|null | Tenant context |
workspace |
string | Workspace/environment |
correlation_id |
string|null | Request trace ID |
actor |
array | Who triggered the event |
payload |
array | Event-specific data |
timestamp |
string (ISO 8601) | When the event was created |
metadata |
array | Retry count, original timestamp |
Lifecycle Hooks
Register before/after hooks in config:
NullEventBus
When EVENTBUS_DRIVER=null (or RABBITMQ_HOST is unset), a NullEventBus is bound that silently discards all published events. Useful for local development and testing.
License
MIT
All versions of eventbus-php with dependencies
php-amqplib/php-amqplib Version ^3.7
ramsey/uuid Version ^4.7
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/log Version ^11.0|^12.0|^13.0