socialite-odnoklassniki icon indicating copy to clipboard operation
socialite-odnoklassniki copied to clipboard

Add support for `::fields()` method

Open mityukov opened this issue 5 years ago • 1 comments

There is an option to request specific set of "user fields", when working wit some of other providers.

Example:

$fbUser = Socialite::with('facebook')
            ->fields([ 'id', 'name', 'email', 'picture' ])
            ->user();

$vkUser = $user = Socialite::with('vkontakte')
            ->fields([ 'photo_50', 'email' ])
            ->user();

With this provider, however, this method doesn't work:

$okUser = Socialite::with('odnoklassniki')
            ->fields([ 'uid', 'name', 'pic50x50', 'email', 'url_profile' ])
            ->user();

The error message I get:

Call to undefined method JhaoDa\SocialiteProviders\Odnoklassniki\Provider::fields()

Is t possible to add ::fields() support here?

mityukov avatar Jul 05 '19 06:07 mityukov

@mityukov feel free to make a pull request with this feature.

jhaoda avatar Jul 05 '19 09:07 jhaoda