I am using "laravel/socialite": "^3.0", to facebook login. But it shows an error
Type error: Argument 1 passed to Laravel\Socialite\SocialiteManager::formatRedirectUrl() must be of the type array, null given, called in /var/www/html/mas/vendor/laravel/socialite/src/SocialiteManager.php.
It happens when I am calling the below function in my login controller
public function socialLogin($social)
{
return Socialite::driver($social)->redirect();
}
Hi you are missing to give credentials of social media put that in config/services.php
'facebook' => [
'client_id' => env('FACEBOOK_CLIENT_ID'),
'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
'redirect' => env('CALLBACK_URL_FACEBOOK'),
],
'google' => [
'client_id' => env('GOOGLE_CLIENT_ID'),
'client_secret' => env('GOOGLE_CLIENT_SECRET'),
'redirect' => env('CALLBACK_URL_GOOGLE'),
],
'twitter' => [
'client_id' => env('TWITTER_CLIENT_ID'),
'client_secret' => env('TWITTER_CLIENT_SECRET'),
'redirect' => env('CALLBACK_URL_TWITTER'),
],
'linkedin' => [
'client_id' => env('LINKEDIN_CLIENT_ID'),
'client_secret' => env('LINKEDIN_CLIENT_SECRET'),
'redirect' => env('CALLBACK_URL_LINKEDIN'),
],
'instagram' => [
'client_id' => env('INSTAGRAM_CLIENT_ID'),
'client_secret' => env('INSTAGRAM_CLIENT_SECRET'),
'redirect' => env('CALLBACK_URL_INSTAGRAM'),
],