简体   繁体   中英

Laravel Socialite - get date of birth and email while loging in with facebook

This is in my routes

Route::get('auth/facebook', 'Front@redirectToProvider');

Front.php

public function redirectToProvider()
{
  return Socialite::driver('facebook')->redirect();
}

But in permission window i don't see permission for phone number . how to add that perission?

在此处输入图片说明

在此处输入图片说明

Laravel Framework version 5.2.45

Update : It seems i can't get the phone number but it seems i can get date of birth .My idea was that if i know how to get phone then i can use the same code to get other fields too like email and date of birth . What do i need to add and where to get these fields?

It is not possible to get the phone number of a Facebook User. There is not even a field for it in the user table: https://developers.facebook.com/docs/graph-api/reference/user

About birthday and other fields, see this thread: How to get birthday gender and religion information using laravel socialite implementing facebook Api

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM