PHPackages                             ahloul/rabbitevents-mod - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. ahloul/rabbitevents-mod

ActiveLibrary[Queues &amp; Workers](/categories/queues)

ahloul/rabbitevents-mod
=======================

Laravel back-to-back broadcasting events. It uses RabbitMQ as the transport.

6.0.6(4y ago)028.2kMITPHPPHP ^7.3|^8.0

Since Oct 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ahloul/rabbitevents-mod)[ Packagist](https://packagist.org/packages/ahloul/rabbitevents-mod)[ RSS](/packages/ahloul-rabbitevents-mod/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (42)Used By (0)

Events publishing for Laravel by using RabbitMQ
===============================================

[](#events-publishing-for-laravel-by-using-rabbitmq)

[![Tests Status](https://github.com/Ecavalier/rabbitevents/workflows/Unit%20tests/badge.svg?branch=master)](https://github.com/Ecavalier/rabbitevents/actions?query=branch%3Amaster+workflow%3A%22Unit+tests%22)[![codecov](https://camo.githubusercontent.com/13e07a88d83279bab23e6a3ef11d00f4e3b17af3aa273268b1efed199649ddeb/68747470733a2f2f636f6465636f762e696f2f67682f45636176616c6965722f7261626269746576656e74732f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d38453943593638363652)](https://codecov.io/gh/Ecavalier/rabbitevents)[![Total Downloads](https://camo.githubusercontent.com/4c617ddec91d5364d6ec65f99e0c9bd500c23f6df04811f455a37553ee9d6af7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f45636176616c6965722f7261626269746576656e7473)](https://packagist.org/packages/Ecavalier/rabbitevents)[![Latest Version](https://camo.githubusercontent.com/174df81072548b458d7ae181386b599027800ed1985531fa4e88c1923d26f480/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f45636176616c6965722f7261626269746576656e7473)](https://packagist.org/packages/Ecavalier/rabbitevents)[![License](https://camo.githubusercontent.com/cfa3be431b2abe2c4aad265440099632c0bf425011c24ad5b8547a3a57bb593a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f45636176616c6965722f7261626269746576656e7473)](https://packagist.org/packages/Ecavalier/rabbitevents)

[This fork form nuwber/rabbitevents](https://github.com/nuwber/rabbitevents)

events provides a simple observer implementation, allowing you to listen for various events that occur in your current and another applications. For example if you need to react to some event published from another API.

Do not confuse this package with Laravel's broadcast. This package was made to communicate a backend to backend.

It's actually a compilation of Laravel's [events](https://laravel.com/docs/events) and [queues](https://laravel.com/docs/queues) with some improvements, such as [middleware](#middleware).

Listener classes are typically stored in the `app/Listeners` folder. You may use Laravel's artisan command to generate them as it described in the [official documentation](https://laravel.com/docs/events).

All RabbitMQ calls are done by using [Laravel queue package](https://github.com/php-enqueue/laravel-queue) as an example. So for better understanding read their documentation first.

Table of contents
=================

[](#table-of-contents)

1. [Installation](#installation)
    - [Configuration](#configuration)
2. [Events](#events)
    - [Defining Events](#defining-events%22)
    - [Retrying Failed Events](#retry-failed-events)
3. [Listeners](#listeners)
    - [Register a Listener](#register-regular-listener)
        - [Wildcard Listeners](#register-wildcard-listeners)
    - [Defining Listeners](#defining-listeners)
        - [Listeners for wildcard events](#defining-wildcard-listeners)
    - [Middleware](#listener-middleware)
    - [Stopping The Propagation](#stopping-propagination)
4. [Console commands](#commands)
    - [rabbitevents:install](#command-install) - install package assets
    - [rabbitevents:listen](#command-listen) - listen to an event
    - [rabbitevents:list](#command-list) - display list of registered events
    - [rabbitevents:make:observer](#command-make-observer) - make an Eloquent model events observer
5. [Logging](#logging)
6. [Testing](#testing)
7. [Examples](/examples)
8. [Non-standard use](#non-standard-use)

Installation
=====================================================

[](#installation-)

You may use Composer to install RabbitEvents into your Laravel project:

```
$ composer require Ecavalier/rabbitevents
```

After installing RabbitEvents, publish its config and a service provider using the `rabbitevents:install` Artisan command:

```
$ php artisan rabbitevents:install
```

Configuration
-------------------------------------------------------

[](#configuration-)

After publishing assets, its primary configuration file will be located at `config/rabbitevents.php`. This configuration file allows you to configure your connection and logging options.

It's very similar to queue connection but now you'll never be confused if you have another connection to RabbitMQ.

```
