Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit bc4bc38

Browse files
authored
Skip loading mongo session driver when session driver is not mongodb. (#14)
1 parent 1bdc2b3 commit bc4bc38

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "1ff/laravel-mongodb-session",
33
"description": "A mongodb session driver for laravel",
44
"type": "library",
5-
"version": "4.0.0",
5+
"version": "4.0.1",
66
"require": {
77
"jenssegers/mongodb": "~3.9",
88
"illuminate/session": "^9.0"

src/SessionServiceProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
class SessionServiceProvider extends ParentServiceProvider
1111
{
12-
1312
/**
1413
* Register any application services.
1514
*
@@ -19,6 +18,10 @@ class SessionServiceProvider extends ParentServiceProvider
1918
*/
2019
public function boot()
2120
{
21+
if (config('session.driver') !== 'mongodb') {
22+
return;
23+
}
24+
2225
Session::extend('mongodb', function ($app) {
2326
$configs = $app['config']->get('session');
2427
$connection = $app['db']->connection($configs['connection'] ?? null);

0 commit comments

Comments
 (0)