AdamWathan\EloquentOAuthL5\EloquentOAuthServiceProvider::registerOAuthManager PHP Method

registerOAuthManager() protected method

protected registerOAuthManager ( )
    protected function registerOAuthManager()
    {
        $this->app['adamwathan.oauth'] = $this->app->share(function ($app) {
            $providerRegistry = new ProviderRegistry();
            $session = new Session($app['session']);
            $request = new Request($app['request']->all());
            $stateGenerator = new StateGenerator();
            $socialnorm = new SocialNorm($providerRegistry, $session, $request, $stateGenerator);
            $this->registerProviders($socialnorm, $request);
            if ($app['config']['eloquent-oauth.model']) {
                $users = new UserStore($app['config']['eloquent-oauth.model']);
            } else {
                if ($app['config']['auth.providers.users.model']) {
                    $users = new UserStore($app['config']['auth.providers.users.model']);
                } else {
                    $users = new UserStore($app['config']['auth.model']);
                }
            }
            $authenticator = new Authenticator($app['Illuminate\\Contracts\\Auth\\Guard'], $users, $app['AdamWathan\\EloquentOAuth\\IdentityStore']);
            $oauth = new OAuthManager($app['redirect'], $authenticator, $socialnorm);
            return $oauth;
        });
    }