Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
42.86% |
6 / 14 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
MongoPasswordResetServiceProvider | |
42.86% |
6 / 14 |
|
0.00% |
0 / 1 |
1.19 | |
0.00% |
0 / 1 |
register | |
42.86% |
6 / 14 |
|
0.00% |
0 / 1 |
1.19 |
1 | <?php |
2 | // app/Auth/MongoPasswordResetServiceProvider.php |
3 | namespace App\Auth; |
4 | |
5 | use Illuminate\Auth\Passwords\PasswordResetServiceProvider; |
6 | use Illuminate\Auth\Passwords\PasswordBrokerManager; |
7 | |
8 | class MongoPasswordResetServiceProvider extends PasswordResetServiceProvider |
9 | { |
10 | public function register() |
11 | { |
12 | $this->app->singleton('auth.password', function ($app) { |
13 | return new PasswordBrokerManager($app); |
14 | }); |
15 | |
16 | $this->app->bind('auth.password.broker', function ($app) { |
17 | return $app->make('auth.password')->broker(); |
18 | }); |
19 | |
20 | // Registrar o custom repository |
21 | $this->app->singleton('auth.password.tokens', function ($app) { |
22 | $config = $app['config']['auth.passwords.users'] ?? []; |
23 | return new MongoPasswordResetRepository( |
24 | $app['hash'], |
25 | $app['config']['app.key'], |
26 | $config['expire'] ?? 60 |
27 | ); |
28 | }); |
29 | } |
30 | } |