neutronical's avatar

Socialite Facebook email null

Hi all,

Any help would be much appreciated please!

I am using Laravel 5.4 and the latest Socialite, yet I am receiving a fatal error when trying to login with Facebook.

Everything seems to work, except the email address of the user is not returned by Facebook, so I'm getting a MySQL error as column 'email' cannot be null.

Any ideas why please?

0 likes
3 replies
carlosmtns's avatar

At your User class, do you have email field on:

protected $fillable = [
        'name', 'email', 'avatar',
    ];

neutronical's avatar

I sure do. Socialite is working nicely with Google.

The problem lies somewhere before this, because the data being returned by Facebook does not have the user's email address in it.

carlosmtns's avatar

And have you tried with different Facebook accounts?

Because Facebook users can register using a phone number instead of an email address, and for that reason you may have that null value.

Please or to participate in this conversation.