0

Routes.php

Route::get('login/facebook', 'Auth\LoginController@redirectToProvider');
Route::get('login/facebook/callback', 'Auth\LoginController@handleProviderCallback');

Services.php

'facebook' => [
    'client_id' => env('FB_KEY','188636635048329'),         // Your facbook Client ID
    'client_secret' => env('FB_SECRET','d16af66a2e168d05d87e76d618b48225'), // Your facbook Client Secret
    'redirect' => 'FB_CALLBACK','http://localhost:8000/login/facebook/callback',
],

LoginController.php

public function redirectToProvider()
{
    return Socialite::driver('facebook')->redirect();
}
public function handleProviderCallback()
{
    $user = Socialite::driver('facebook')->user();
    return $user->token;
}

I followed up with laravel Socialite Documentation but it didn't work it just showed The parameter app_id is required i trued to clear Config cache but it didn't work neither and i tried to put in .env file

FB_KEY = 188636635048329
FB_SECRET=d16af66a2e168d05d87e76d618b48225
FB_CALLBACK=http://localhost:8000/login/facebook/callback 

but it didnt work so what else i can do to make it work

FirstOne
  • 6,033
  • 7
  • 26
  • 45
Ahmed Sobh
  • 11
  • 1

1 Answers1

0

solution

The error was in the .env file i left some space in the FB_KEY so it should be like that

FB_KEY=188636635048329
Ahmed Sobh
  • 11
  • 1