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

Commit 670b076

Browse files
committed
Laravel 5.2 update
- Use new `provider` method for registering the auth user provider - Updated tests
1 parent a694037 commit 670b076

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/AdldapAuthServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public function boot()
3030

3131
$this->mergeConfigFrom($auth, 'adldap_auth');
3232

33-
// Extend Laravel authentication with Adldap driver.
34-
Auth::extend('adldap', function ($app) {
35-
return new AdldapAuthUserProvider($app['hash'], $app['config']['auth.model']);
33+
// Register the adldap auth user provider.
34+
Auth::provider('adldap', function ($app, array $config) {
35+
return new AdldapAuthUserProvider($app['hash'], $config['model']);
3636
});
3737
}
3838

tests/FunctionalTestCase.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,14 @@ protected function getEnvironmentSetup($app)
3939
$app['config']->set('adldap.auto_connect', false);
4040
$app['config']->set('adldap_auth.bind_user_to_model', true);
4141

42-
$app['config']->set('auth.driver', 'adldap');
43-
$app['config']->set('auth.model', 'Adldap\Laravel\Tests\Models\User');
42+
$app['config']->set('auth.guards.web.provider', 'adldap');
43+
44+
$app['config']->set('auth.providers', [
45+
'adldap' => [
46+
'driver' => 'adldap',
47+
'model' => 'Adldap\Laravel\Tests\Models\User',
48+
],
49+
]);
4450
}
4551

4652
/**

0 commit comments

Comments
 (0)