Skip to content

Commit

Permalink
add Auth provider to Service Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Roussel Xavier committed Jan 20, 2016
1 parent 619edac commit a3fa899
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/LdapServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php namespace Xavrsl\Ldap;

use Illuminate\Support\Facades\Auth;
use Illuminate\Support\ServiceProvider;
use Xavrsl\Ldap\Providers\LdapAuthUserProvider;

class LdapServiceProvider extends ServiceProvider {

Expand All @@ -21,6 +23,10 @@ public function boot()
$this->publishes([
__DIR__ . '/config/ldap.php' => config_path('ldap.php'),
]);

Auth::provider('ldap', function ($app, array $config) {
return new LdapAuthUserProvider($app['hash'], $config['model']);
});
}

/**
Expand Down

0 comments on commit a3fa899

Please sign in to comment.