Adldap\Laravel\AdldapAuthServiceProvider::boot PHP Méthode

boot() public méthode

Run service provider boot operations.
public boot ( ) : void
Résultat void
    public function boot()
    {
        $config = __DIR__ . '/Config/auth.php';
        // Add publishable configuration.
        $this->publishes([$config => config_path('adldap_auth.php')], 'adldap');
        $this->mergeConfigFrom($config, 'adldap_auth');
        $auth = Auth::getFacadeRoot();
        if (method_exists($auth, 'provider')) {
            // If the provider method exists, we're running Laravel 5.2.
            // Register the adldap auth user provider.
            $auth->provider('adldap', function ($app, array $config) {
                return $this->newUserProvider($app['hash'], $config);
            });
        } else {
            // Otherwise we're using 5.0 || 5.1
            // Extend Laravel authentication with Adldap driver.
            $auth->extend('adldap', function ($app) {
                return $this->newUserProvider($app['hash'], $app['config']['auth']);
            });
        }
        $this->commands([Import::class]);
    }