codemaxbr/rabbitmq

RabbitMQ Adapter for Laravel

dev-master 2021-03-27 22:37 UTC

This package is auto-updated.

Last update: 2024-03-28 05:24:07 UTC


README

Adaptation of the php-amqplib package for use in Laravel made with much 💕

For more information on php-aqpmqblib package visit their repository

🚀 Installation

Require the codemaxbr/rabbitmq package in your composer.json and update your dependencies:

composer require geekshubs/rabbitmq

Add env parameters to configuration in Lumen and Laravel.

RABBITMQ_HOST=rabbit
RABBITMQ_PORT=5672
RABBITMQ_USER=rabbitmq
RABBITMQ_PASSWORD=rabbitmq
RABBITMQ_VHOST='/'

In app/config/app.php add the following :

The ServiceProvider to the providers array :

CodemaxBR\RabbitMQ\RabbitMQServiceProvider::class,

💡 Lumen

On Lumen, just register the ServiceProvider manually in your bootstrap/app.php file:

$app->register(\CodemaxBR\RabbitMQ\RabbitMQServiceProvider::class);

and add this lines in same file.

//Add lines to error reflection class
$app->instance('path.config', app()->basePath() . DIRECTORY_SEPARATOR . 'config');
$app->instance('path.storage', app()->basePath() . DIRECTORY_SEPARATOR . 'storage');