So, I was thinking and realized that it's a pretty stupid way to use the Service Container, not really the way it's supposed to be. So what I did was this:
Rewrite the bindCLass() function:
private function bindClass()
{
foreach ( \Config::get('social-auth.providers') as $name => $provider )
{
$this->app->bind('SocialAuth\\' . $name, $provider);
}
}
Now it binds all the providers into the service container.
Hence, here's the resolver inside the controller:
private function resolve($provider)
{
$this->provider = \App::make('SocialAuth\\' . ucfirst($provider));
}
Like this it all works and makes some more sense.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community