PHP Developers Network
http://forums.devnetwork.net/

Laravel socialite facebook login does not work.. (ed:Solved)
http://forums.devnetwork.net/viewtopic.php?f=72&t=144725
Page 1 of 1

Author:  hybris [ Thu Nov 23, 2017 6:04 am ]
Post subject:  Laravel socialite facebook login does not work.. (ed:Solved)

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());

Syntax: [ Download ] [ Hide ]
public function callback()
    {
        $user = $service->createOrGetUser(Socialite::driver('facebook')->user());
        auth()->login($user);
        return redirect()->to('/home');
    }
 


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 :)

Author:  hybris [ Thu Nov 23, 2017 10:36 am ]
Post subject:  Re: Laravel socialite facebook login does not work..

Never mind.. I got it to work :)

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/