PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Dec 12, 2017 11:08 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Nov 23, 2017 6:04 am 
Offline
Forum Contributor

Joined: Wed Sep 25, 2013 4:09 am
Posts: 172
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 :)


Last edited by hybris on Thu Nov 23, 2017 10:37 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Nov 23, 2017 10:36 am 
Offline
Forum Contributor

Joined: Wed Sep 25, 2013 4:09 am
Posts: 172
Never mind.. I got it to work :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group