Skip to content

Commit 665735b

Browse files
committed
Check version
1 parent 76ab5bc commit 665735b

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

src/Jenssegers/Mongodb/Auth/PasswordBrokerManager.php

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,23 @@ class PasswordBrokerManager extends BasePasswordBrokerManager
99
*/
1010
protected function createTokenRepository(array $config)
1111
{
12-
return new DatabaseTokenRepository(
13-
$this->app['db']->connection(),
14-
$this->app['hash'],
15-
$config['table'],
16-
$this->app['config']['app.key'],
17-
$config['expire']
18-
);
12+
$laravel = app();
13+
14+
if (starts_with($laravel::VERSION, '5.4') {
15+
return new DatabaseTokenRepository(
16+
$this->app['db']->connection(),
17+
$this->app['hash'],
18+
$config['table'],
19+
$this->app['config']['app.key'],
20+
$config['expire']
21+
);
22+
} else {
23+
return new DatabaseTokenRepository(
24+
$this->app['db']->connection(),
25+
$config['table'],
26+
$this->app['config']['app.key'],
27+
$config['expire']
28+
);
29+
}
1930
}
2031
}

0 commit comments

Comments
 (0)