@@ -42,6 +42,8 @@ This package adds functionalities to the Eloquent model and Query builder for Mo
42
42
- [ Cross-Database Relationships] ( #cross-database-relationships )
43
43
- [ Authentication] ( #authentication )
44
44
- [ Queues] ( #queues )
45
+ - [ Laravel specific] ( #laravel-specific )
46
+ - [ Lumen specific] ( #Lumen-specific )
45
47
- [ Upgrading] ( #upgrading )
46
48
- [ Upgrading from version 2 to 3] ( #upgrading-from-version-2-to-3 )
47
49
@@ -1067,6 +1069,8 @@ If you want to use MongoDB as your database backend, change the driver in `confi
1067
1069
'connections' => [
1068
1070
'database' => [
1069
1071
'driver' => 'mongodb',
1072
+ // You can also specify your jobs specific database created on config/database.php
1073
+ 'connection' => 'mongodb-job',
1070
1074
'table' => 'jobs',
1071
1075
'queue' => 'default',
1072
1076
'expire' => 60,
@@ -1078,23 +1082,31 @@ If you want to use MongoDB to handle failed jobs, change the database in `config
1078
1082
1079
1083
``` php
1080
1084
'failed' => [
1081
- 'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
1082
- 'database' => env('DB_CONNECTION', 'mongodb'),
1085
+ 'driver' => 'mongodb',
1086
+ // You can also specify your jobs specific database created on config/database.php
1087
+ 'database' => 'mongodb-job',
1083
1088
'table' => 'failed_jobs',
1084
1089
],
1085
1090
```
1086
1091
1087
- Or simply set your own ` QUEUE_FAILED_DRIVER ` environment variable to ` mongodb `
1088
- ``` env
1089
- QUEUE_FAILED_DRIVER=mongodb
1090
- ```
1092
+ #### Laravel specific
1091
1093
1092
- Last, add the service provider in ` config/app.php ` :
1094
+ Add the service provider in ` config/app.php ` :
1093
1095
1094
1096
``` php
1095
1097
Jenssegers\Mongodb\MongodbQueueServiceProvider::class,
1096
1098
```
1097
1099
1100
+ #### Lumen specific
1101
+
1102
+ With [ Lumen] ( http://lumen.laravel.com ) , add the service provider in ` bootstrap/app.php ` . You must however ensure that you add the following ** after** the ` MongodbServiceProvider ` registration.
1103
+
1104
+ ``` php
1105
+ $app->make('queue');
1106
+
1107
+ $app->register(Jenssegers\Mongodb\MongodbQueueServiceProvider::class);
1108
+ ```
1109
+
1098
1110
Upgrading
1099
1111
---------
1100
1112
0 commit comments