driver = $driver; $this->resolver = $resolver; $this->user = $user; } /** * Redirect the user to the authentication page for the provider. * * @return \Symfony\Component\HttpFoundation\RedirectResponse|\Illuminate\Http\RedirectResponse */ public function redirect() { return new RedirectResponse('https://socialite.fake/'.$this->driver.'/authorize'); } /** * Get the User instance for the authenticated user. * * @return \Laravel\Socialite\Contracts\User */ public function user() { if ($this->user instanceof Closure) { return ($this->user)(); } return $this->user ?? $this->provider()->user(); } /** * Get the original provider instance. * * @return \Laravel\Socialite\Contracts\Provider */ public function provider() { if (isset($this->provider)) { return $this->provider; } return $this->provider = ($this->resolver)(); } /** * Handle calls to methods that are not available on the fake provider. * * @param string $method */ public function __call($method, array $parameters) { return $this->forwardDecoratedCallTo($this->provider(), $method, $parameters); } }