From 4c100d23b3dca108c402797a09a24c3837f8f09e Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 10 Jun 2018 10:01:59 +0200 Subject: [PATCH] app/models/Data/User.php: adding getSocialLinks() --- app/models/Data/User.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/models/Data/User.php b/app/models/Data/User.php index 82c438e..a01d346 100644 --- a/app/models/Data/User.php +++ b/app/models/Data/User.php @@ -247,6 +247,17 @@ class User extends Model return $this; } + public function getSocialLinks() + { + $providers = [ + 'github' => $this->getGithubId(), + 'gitlab' => $this->getGitlabId(), + 'google' => $this->getGoogleId() + ]; + + return array_filter($providers); + } + static public function createFromOAuthData(UserDataInterface $data) { $oauth_id = 'set' . $data->getProvider() . 'Id';