PHPackages                             usmonaliyev/laravel-simple-rabbitmq - 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. usmonaliyev/laravel-simple-rabbitmq

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

usmonaliyev/laravel-simple-rabbitmq
===================================

This package provides simple usage of rabbitmq.

1.2.0(11mo ago)778.7k↑28.8%8[2 issues](https://github.com/usmonaliyev99/laravel-simple-rabbitmq/issues)MITPHPPHP ^8.1

Since Nov 10Pushed 11mo ago2 watchersCompare

[ Source](https://github.com/usmonaliyev99/laravel-simple-rabbitmq)[ Packagist](https://packagist.org/packages/usmonaliyev/laravel-simple-rabbitmq)[ Docs](https://github.com/usmonaliyev/laravel-simple-rabbitmq)[ RSS](/packages/usmonaliyev-laravel-simple-rabbitmq/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (7)Versions (9)Used By (0)

laravel-simple-rabbitmq
=======================

[](#laravel-simple-rabbitmq)

 [![](https://camo.githubusercontent.com/dc8f82b10806f29fd4eec7bde6059d51f6dbe707fb283da27404640102c2aed9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f75736d6f6e616c697965762f6c61726176656c2d73696d706c652d7261626269746d712f706870)](https://camo.githubusercontent.com/dc8f82b10806f29fd4eec7bde6059d51f6dbe707fb283da27404640102c2aed9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f75736d6f6e616c697965762f6c61726176656c2d73696d706c652d7261626269746d712f706870) [![](https://camo.githubusercontent.com/d5e26e1a1cdacb5d5445327dafee5f335f2896c7f0a6c4484c86d14e763f8fc0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f75736d6f6e616c697965762f6c61726176656c2d73696d706c652d7261626269746d712e737667)](https://camo.githubusercontent.com/d5e26e1a1cdacb5d5445327dafee5f335f2896c7f0a6c4484c86d14e763f8fc0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f75736d6f6e616c697965762f6c61726176656c2d73696d706c652d7261626269746d712e737667) [![](https://camo.githubusercontent.com/968e71f3f62ac0e8dad4c565921de51c8c2ab1c2b23935dc96eaedf36d357005/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f75736d6f6e616c697965762f6c61726176656c2d73696d706c652d7261626269746d712e737667)](https://camo.githubusercontent.com/968e71f3f62ac0e8dad4c565921de51c8c2ab1c2b23935dc96eaedf36d357005/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f75736d6f6e616c697965762f6c61726176656c2d73696d706c652d7261626269746d712e737667) [![](https://camo.githubusercontent.com/2fb2ddc52dd8a055ec2eb201f0628b5136923e2a9589cf497854deb5005f1760/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f75736d6f6e616c697965762f6c61726176656c2d73696d706c652d7261626269746d71)](https://camo.githubusercontent.com/2fb2ddc52dd8a055ec2eb201f0628b5136923e2a9589cf497854deb5005f1760/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f75736d6f6e616c697965762f6c61726176656c2d73696d706c652d7261626269746d71)

The package for simplified RabbitMQ usage, supporting multiple connections, easy publishing, and consumer mode.

Documentation
-------------

[](#documentation)

- [Русский (RU)](README.RU.md)
- [O'zbekcha (UZ)](README.UZ.md)

### Key Features

[](#key-features)

- **Multiple Connections**: Effortlessly manage multiple RabbitMQ connections within the same application.
- **Exchange supporting**: You can push messages to exchanges
- **Message Publishing**: Easily publish messages to queues and exchange with a fluent, chainable syntax.
- **Consumer Mode**: Enable consumers to receive and process messages from queues in real time.
- **Manage queues and exchanges in config file**: You can register queues and exchanges in `config/simple-mq.php` and define them in easy way which is `amqp:define-queues` command.

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

[](#installation)

You can install the package via composer:

```
composer require usmonaliyev/laravel-simple-rabbitmq
```

Next step you must publish config and action register files:

```
php artisan vendor:publish --provider="Usmonaliyev\SimpleRabbit\SimpleRabbitMQServiceProvider"
```

As a result of this command, you will have a configuration file `config/simple-mq.php` and a registry file `routes/amqp-handlers.php`.

The `config/simple-mq.php` config file contains RabbitMQ connections with credentials, queues, default connection and default queue.

The next stage is configure `.env` file.

```
SIMPLE_MQ_CONNECTION=
SIMPLE_MQ_QUEUE=

SIMPLE_MQ_HOST=
SIMPLE_MQ_PORT=
SIMPLE_MQ_USERNAME=
SIMPLE_MQ_PASSWORD=

```

Usage
-----

[](#usage)

The package can publish and consume messages

### Publishing

[](#publishing)

You can publish a message with default connection and default queue:

```
