Skip to content

Commit 43d3889

Browse files
committed
vyuldashev#225 laravel horizon support
1 parent 23f7f3b commit 43d3889

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ Setup connection in `config/queue.php`
2525

2626
'driver' => 'rabbitmq',
2727

28+
/*
29+
* Set to "horizon" if you wish to use Laravel Horizon.
30+
*/
31+
'worker' => env('RABBITMQ_WORKER', 'default'),
32+
2833
'dsn' => env('RABBITMQ_DSN', null),
2934

3035
/*
@@ -120,16 +125,22 @@ Setup connection in `config/queue.php`
120125
],
121126
```
122127

128+
## Laravel Usage
129+
130+
Once you completed the configuration you can use Laravel Queue API. If you used other queue drivers you do not need to change anything else. If you do not know how to use Queue API, please refer to the official Laravel documentation: http://laravel.com/docs/queues
131+
132+
## Laravel Horizon Usage
133+
134+
This package supports [Laravel Horizon](http://horizon.laravel.com) out of the box. Firstly, install Horizon and then set `RABBITMQ_WORKER` to `horizon`.
135+
123136
## Lumen Usage
124137

125-
For lumen usage the service provider should be registered manually as follow in bootstrap/app.php
126-
```
138+
For Lumen usage the service provider should be registered manually as follow in `bootstrap/app.php`:
139+
140+
```php
127141
$app->register(VladimirYuldashev\LaravelQueueRabbitMQ\LaravelQueueRabbitMQServiceProvider::class);
128142
```
129143

130-
## Usage
131-
132-
Once you completed the configuration you can use Laravel Queue API. If you used other queue drivers you do not need to change anything else. If you do not know how to use Queue API, please refer to the official Laravel documentation: http://laravel.com/docs/queues
133144

134145
## Using other AMQP transports
135146

@@ -157,10 +168,15 @@ Change the factory class in `config/queue.php`:
157168

158169
## Testing
159170

160-
You can run the tests with:
171+
Setup RabbitMQ using `docker-compose`:
172+
```bash
173+
docker-compose up -d
174+
```
175+
176+
Run tests:
161177

162178
``` bash
163-
vendor/bin/phpunit
179+
composer test
164180
```
165181

166182
## Contribution

config/rabbitmq.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
'driver' => 'rabbitmq',
1111

1212
/*
13-
* Set to horizon if you wish to use Laravel Horizon.
13+
* Set to "horizon" if you wish to use Laravel Horizon.
1414
*/
1515
'worker' => env('RABBITMQ_WORKER', 'default'),
1616

0 commit comments

Comments
 (0)