11# laravel-pubsub
22
3- A Pub-Sub abstraction for Laravel.
3+ A Pub-Sub abstraction for Laravel and Lumen .
44
55[ ![ Author] ( http://img.shields.io/badge/author-@superbalist-blue.svg?style=flat-square )] ( https://twitter.com/superbalist )
66[ ![ Build Status] ( https://img.shields.io/travis/Superbalist/laravel-pubsub/master.svg?style=flat-square )] ( https://travis-ci.org/Superbalist/laravel-pubsub )
@@ -9,14 +9,16 @@ A Pub-Sub abstraction for Laravel.
99[ ![ Packagist Version] ( https://img.shields.io/packagist/v/superbalist/laravel-pubsub.svg?style=flat-square )] ( https://packagist.org/packages/superbalist/laravel-pubsub )
1010[ ![ Total Downloads] ( https://img.shields.io/packagist/dt/superbalist/laravel-pubsub.svg?style=flat-square )] ( https://packagist.org/packages/superbalist/laravel-pubsub )
1111
12- This package is a wrapper bridging [ php-pubsub] ( https://github.com/Superbalist/php-pubsub ) into Laravel.
12+ This package is a wrapper bridging [ php-pubsub] ( https://github.com/Superbalist/php-pubsub ) into Laravel and Lumen .
1313
1414For ** Laravel 4** support, use the package https://github.com/Superbalist/laravel4-pubsub
1515
1616Please note that ** Laravel 5.3** is only supported up until version 2.0.2.
1717
18182.0.3+ supports ** Laravel 5.4 and up** moving forward.
1919
20+ 3.0.1+ supports ** Lumen 5.5 and up** moving forward.
21+
2022The following adapters are supported:
2123* Local
2224* /dev/null
@@ -25,7 +27,7 @@ The following adapters are supported:
2527* Google Cloud
2628* HTTP
2729
28- ## Installation
30+ ## Laravel Installation
2931
3032``` bash
3133composer require superbalist/laravel-pubsub
@@ -35,7 +37,7 @@ Register the service provider in app.php
3537``` php
3638'providers' => [
3739 // ...
38- Superbalist\LaravelPubSub\PubSubServiceProvider ::class,
40+ Superbalist\LaravelPubSub\PubSubLaravelServiceProvider ::class,
3941]
4042```
4143
@@ -47,6 +49,40 @@ Register the facade in app.php
4749]
4850```
4951
52+ To customize the configuration file, publish the package configuration using Artisan.
53+ ``` bash
54+ php artisan vendor:publish --provider=" Superbalist\LaravelPubSub\PubSubServiceProvider"
55+ ```
56+
57+ You can then edit the generated config at ` app/config/pubsub.php ` .
58+
59+ ## Lumen Installation
60+
61+ ``` bash
62+ composer require superbalist/laravel-pubsub
63+ ```
64+
65+ Register the service provider in app.php
66+ ``` php
67+ $app->register(Superbalist\LaravelPubSub\PubSubLumenServiceProvider::class);
68+ ```
69+
70+ Register the facade in app.php
71+ ``` php
72+ if (!class_exists('PubSub')) {
73+ class_alias('Superbalist\LaravelPubSub\PubSubFacade', 'PubSub');
74+ }
75+ ```
76+
77+ To customize the configuration file, publish the package configuration using Artisan.
78+ ``` bash
79+ cp vendor/superbalist/laravel-pubsub/config/pubsub.php config/pubsub.php
80+ ```
81+
82+ You can then edit the generated config at ` config/pubsub.php ` .
83+
84+ ## Configuration
85+
5086The package has a default configuration which uses the following environment variables.
5187```
5288PUBSUB_CONNECTION=redis
@@ -64,12 +100,7 @@ HTTP_PUBSUB_URI=null
64100HTTP_PUBSUB_SUBSCRIBE_CONNECTION=redis
65101```
66102
67- To customize the configuration file, publish the package configuration using Artisan.
68- ``` bash
69- php artisan vendor:publish --provider=" Superbalist\LaravelPubSub\PubSubServiceProvider"
70- ```
71103
72- You can then edit the generated config at ` app/config/pubsub.php ` .
73104
74105## Kafka Adapter Installation
75106
0 commit comments