當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserRepository::findByEmailOrCreate方法代碼示例

本文整理匯總了PHP中App\Repositories\UserRepository::findByEmailOrCreate方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserRepository::findByEmailOrCreate方法的具體用法?PHP UserRepository::findByEmailOrCreate怎麽用?PHP UserRepository::findByEmailOrCreate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在App\Repositories\UserRepository的用法示例。


在下文中一共展示了UserRepository::findByEmailOrCreate方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 /**
  * @param boolean $hasCode
  * @param AuthenticateUserListener $listener
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute($hasCode, AuthenticateUserListener $listener, $provider)
 {
     if (!$hasCode) {
         return $this->getAuthorizationFirst($provider);
     }
     $user = $this->users->findByEmailOrCreate($this->getSocialUser($provider));
     \Auth::login($user, true);
     return $listener->userHasLoggedIn($user);
 }
開發者ID:shoieb0101,項目名稱:lara-admin,代碼行數:14,代碼來源:AuthenticateUser.php

示例2: execute

 public function execute($hasCode)
 {
     if (!$hasCode) {
         return $this->getAuthFirst();
     }
     $user = $this->users->findByEmailOrCreate($this->getGithubUser());
     Auth::loginUsingId($user->id, true);
     return redirect('/profile');
 }
開發者ID:steveperrito,項目名稱:flora-laravel,代碼行數:9,代碼來源:AuthenticateUser.php

示例3: execute

 /**
  * @param string $driver facebook/twitter/google+/github/etc
  * @param bool $hasCode
  * @param AuthenticateUserListener $listener
  * @return mixed
  */
 public function execute($driver, $hasCode, AuthenticateUserListener $listener)
 {
     if (!$hasCode) {
         return $this->getAuthorizationFirst($driver);
     }
     $user = $this->users->findByEmailOrCreate($this->getUser($driver));
     $this->auth->login($user, true);
     return $listener->userHasLoggedIn($user);
 }
開發者ID:banderon1,項目名稱:faces,代碼行數:15,代碼來源:AuthenticateUser.php

示例4: execute

 /**
  * @param $hasCode
  * @param $listener
  * @param $social_provider
  * @return mixed
  */
 public function execute($hasCode, AuthenticateUserListener $listener, $social_provider)
 {
     if (!$hasCode) {
         return $this->getAuthorizationFirst($social_provider);
     }
     $user = $this->users->findByEmailOrCreate($this->getSocialUser($social_provider));
     if ($user == 'isDuplicate') {
         Session::flash('message', "There some problems with your login! Credentials do not match. ");
         Session::flash('alert-class', 'alert-danger');
         return redirect()->back();
     }
     $this->auth->login($user, true);
     return $listener->userHasLoggedIn($user);
 }
開發者ID:JolitaGrazyte,項目名稱:intoBelgium,代碼行數:20,代碼來源:AuthenticateUser.php

示例5: execute

 /**
  * @param $hasCode
  * @param $listener
  * @param $social_provider
  * @return mixed
  */
 public function execute($hasCode, AuthenticateUserListener $listener, $social_provider)
 {
     //        dd($hasCode);
     if (!$hasCode) {
         return $this->getAuthorizationFirst($social_provider);
     }
     $user = $this->users->findByEmailOrCreate($this->getSocialUser($social_provider));
     if (!$user) {
         Session::flash('message', "Something went wrong!");
         Session::flash('alert-class', 'error');
     }
     $this->auth->login($user, true);
     //        event(new \App\Events\UserEvent($user->full_name));
     return $listener->userHasBeenRegistered($user);
 }
開發者ID:JolitaGrazyte,項目名稱:lockedornot,代碼行數:21,代碼來源:AuthenticateUser.php

示例6: execute

 /**
  * @param $hasCode
  * @param $listener
  * @param $social_provider
  * @return mixed
  */
 public function execute($hasCode, AuthenticateUserListener $listener, $social_provider)
 {
     if (!$hasCode) {
         return $this->getAuthorizationFirst($social_provider);
     }
     $user = $this->users->findByEmailOrCreate($this->getSocialUser($social_provider), $this->ip);
     if (!$user) {
         Session::flash('message', "Something went wrong!");
         Session::flash('alert-class', 'error');
     } else {
         if ($user == 'user exist') {
             return redirect()->route('home');
         }
     }
     return $listener->userHasBeenRegistered($user);
 }
開發者ID:JolitaGrazyte,項目名稱:webdev_examen,代碼行數:22,代碼來源:AuthenticateUser.php


注:本文中的App\Repositories\UserRepository::findByEmailOrCreate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。