PHPackages                             medeiroz/laravel-amqp-toolkit - 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. medeiroz/laravel-amqp-toolkit

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

medeiroz/laravel-amqp-toolkit
=============================

Laravel AMQP Toolkit to publish and consume messages from RabbitMQ

1.1.2(1y ago)43.7k↓100%[3 PRs](https://github.com/medeiroz/laravel-amqp-toolkit/pulls)MITPHPPHP ^8.1CI passing

Since Feb 6Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/medeiroz/laravel-amqp-toolkit)[ Packagist](https://packagist.org/packages/medeiroz/laravel-amqp-toolkit)[ Docs](https://github.com/medeiroz/laravel-amqp-toolkit)[ GitHub Sponsors](https://github.com/Medeiroz)[ RSS](/packages/medeiroz-laravel-amqp-toolkit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (17)Used By (0)

Package PHP/Laravel to manager, consume and publish messages with AMQP / RabbitMQ
=================================================================================

[](#package-phplaravel-to-manager-consume-and-publish-messages-with-amqp--rabbitmq)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7f6dc0ee0e46fb01b124c08eaac4421f535b6c3a821168a0016447321606e09f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d65646569726f7a2f6c61726176656c2d616d71702d746f6f6c6b69742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/medeiroz/laravel-amqp-toolkit)[![GitHub Tests Action Status](https://camo.githubusercontent.com/bbb733913c1f9c77d9b42666fcff7f12e1509582492261b552ad6c5b530e32a3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d65646569726f7a2f6c61726176656c2d616d71702d746f6f6c6b69742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/medeiroz/laravel-amqp-toolkit/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4ee9cb753d0693eb94abf7b06aff52bd3f0bf8f8250162e2ad26badb973f14d0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d65646569726f7a2f6c61726176656c2d616d71702d746f6f6c6b69742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/medeiroz/laravel-amqp-toolkit/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/dcc477609af6e83c849799616d2f430b961d0ba7b7987c5f65ae2c9505094663/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d65646569726f7a2f6c61726176656c2d616d71702d746f6f6c6b69742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/medeiroz/laravel-amqp-toolkit)

This package was developed to facilitate the integration of Laravel applications with RabbitMQ, providing functionalities to consume and publish messages, in addition to providing a simple way to manage the AMQP / RabbitMQ infrastructure through schema migrations, inspired by Laravel's database migrations.

If you need to consume messages from RabbitMQ queues, publish messages in exchanges or queues, or manage the RabbitMQ infrastructure, this package is for you.

If you have a problems to manage the RabbitMQ Schema same as queues, exchanges and shovels, this package is for you.

---

Main Features
-------------

[](#main-features)

1. **Schema Migrations:** Use schema migrations to create, delete and manage queues, exchanges and shovels in RabbitMQ, similar to what Laravel offers for databases.
2. **Consume Queue:** Ability to consume messages from a RabbitMQ queue in a simple and efficient way.
3. **Publish Messages:** Ability to publish messages in exchanges or directly in RabbitMQ queues.
4. **Event Listeners:** Ability to listen to messages received from AMQP / RabbitMQ queues and exchanges, similar to Laravel's event listeners.

---

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Laravel &gt;= 10

Installation
------------

[](#installation)

follow the steps below to install the package:

1. Install the `medeiroz/laravel-amqp-toolkit` package via composer
2. Publish and run migrations
3. Publish the configuration file
4. Environment variables .env
5. Configure the AMQP Queue and Laravel Listeners

### 1. Install the package

[](#1-install-the-package)

Run the command below to install the package via composer:

```
composer require medeiroz/laravel-amqp-toolkit
```

### 2. Publish migrations

[](#2-publish-migrations)

You must publish the database migration with:

```
php artisan vendor:publish --tag="amqp-toolkit-migrations"
```

Then run the command below to create the table in the database.

```
php artisan migrate
```

### 3. Publish the configuration file

[](#3-publish-the-configuration-file)

You can publish the configuration file with:

```
php artisan vendor:publish --tag="amqp-toolkit-config"
```

This is the content of the published configuration file:

```
