当前位置: 首页>>代码示例>>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;未经允许,请勿转载。