diff --git a/README.md b/README.md index 19daed4..5e422fe 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,11 @@ This is the contents of the published config file: 'rabbitmq', - 'port' => '5672', - 'user' => 'guest', - 'password' => 'guest', + 'host' => env('RABBITMQ_HOST', '127.0.0.1'), + 'port' => env('RABBITMQ_PORT', 5672), + 'user' => env('RABBITMQ_USER', 'guest'), + 'password' => env('RABBITMQ_PASSWORD', 'guest'), + 'vhost' => env('RABBITMQ_VHOST', '/'), 'consumers' => [ // [ diff --git a/config/rabbitmq.php b/config/rabbitmq.php index a6991e0..c7abd16 100644 --- a/config/rabbitmq.php +++ b/config/rabbitmq.php @@ -1,11 +1,12 @@ 'rabbitmq', - 'port' => '5672', - 'user' => 'guest', - 'password' => 'guest', - + 'host' => env('RABBITMQ_HOST', '127.0.0.1'), + 'port' => env('RABBITMQ_PORT', 5672), + 'user' => env('RABBITMQ_USER', 'guest'), + 'password' => env('RABBITMQ_PASSWORD', 'guest'), + 'vhost' => env('RABBITMQ_VHOST', '/'), + 'consumers' => [ // [ // 'event' => '\App\Events\MyEvent', diff --git a/src/RabbitMQ.php b/src/RabbitMQ.php index ccce536..8b1e7a3 100644 --- a/src/RabbitMQ.php +++ b/src/RabbitMQ.php @@ -17,7 +17,8 @@ public function __construct() config('rabbitmq.host'), config('rabbitmq.port'), config('rabbitmq.user'), - config('rabbitmq.password') + config('rabbitmq.password'), + config('rabbitmq.vhost') ); $this->channel = $this->connection->channel();