private function getUserDetailsFromSocial($socialUser, $user)
    {
        $names    = explode(' ', $socialUser->getName());
        $username = is_null($socialUser->getNickname())
            ? $socialUser->getEmail()
            : $socialUser->getNickname();

        $details = [
            'user_id'      => $user->id,
            'first_name'   => isset($names[0]) ? $names[0] : null,
            'last_name'    => isset($names[1]) ? $names[1] : null,
            'display_name' => $username,
        ];

        return array_filter($details);
    }
private function getUserDetailsFromSocial($socialUser, $user)
    {
        $names    = explode(' ', $socialUser->getName());
        $username = is_null($socialUser->getNickname())
            ? $socialUser->getEmail()
            : $socialUser->getNickname();

        $details = [
            'user_id'      => $user->id,
            'first_name'   => isset($names[0]) ? $names[0] : null,
            'last_name'    => isset($names[1]) ? $names[1] : null,
            'display_name' => $username,
        ];

        return array_filter($details);
    }
private function getUserDetailsFromSocial ( $ socialUser , $ user ) { $ names = explode ( ' ' , $ socialUser -> getName ( ) ) ; $ username = is_null ( $ socialUser -> getNickname ( ) ) ? $ socialUser -> getEmail ( ) : $ socialUser -> getNickname ( ) ; $ details = [ 'user_id' => $ user -> id , 'first_name' => isset ( $ names [ 0 ] ) ? $ names [ 0 ] : null , 'last_name' => isset ( $ names [ 1 ] ) ? $ names [ 1 ] : null , 'display_name' => $ username , ] ; return array_filter ( $ details ) ; }
Try to get as many details as possible from the social user object.

@param $socialUser
@param $user

@return array
Try to get as many details as possible from the social user object .