Laravel socialite facebook login does not work.. (ed:Solved)
Posted: Thu Nov 23, 2017 5:04 am
Hi, I followed this tutorial: https://appdividend.com/2017/07/12/lara ... ook-login/
to add a facebook login but I get this error:
ErrorException (E_NOTICE)
Undefined variable: service
it is in the callback function:
$user = $service->createOrGetUser(Socialite::driver('facebook')->user());
it says service is an undefined variable.
Where should the $service variable be declared? (I suspect something might have gone wrong when I installed socialite... is there any way to check that?)
Thanks
to add a facebook login but I get this error:
ErrorException (E_NOTICE)
Undefined variable: service
it is in the callback function:
$user = $service->createOrGetUser(Socialite::driver('facebook')->user());
Code: Select all
public function callback()
{
$user = $service->createOrGetUser(Socialite::driver('facebook')->user());
auth()->login($user);
return redirect()->to('/home');
}
Where should the $service variable be declared? (I suspect something might have gone wrong when I installed socialite... is there any way to check that?)
Thanks