/** * Listens for: * User has just attached a new social-auth provider to his existing account. * Does: * Checks if this is the first provider to get attached to the user. If so, create or fill the DatabaseProfile using * the info from this provider. * * @param $parameters */ public function attach($user, $providerName, $profile) { $database_profile = $this->socialProfileRepository->findByUserAndProvider($user, 'UserProfile'); if ($database_profile === null) { $this->copyProfileToDatabase($user, $profile); } }
protected function makeDBProfile() { $db_profile = null; if ($this->user !== null) { $db_profile = $this->profileRepository->findByUserAndProvider($this->user, $this->providerName); } return $db_profile; }
public function getProfile() { $profile = null; $user = \Auth::user(); if ($user !== false) { $profile = $this->profileRepository->findByUserAndProvider($user, 'UserProfile'); } return $profile; }