示例#1
0
 private function findOrCreateUser($user)
 {
     if ($authUser = User::where('github_id', $user->id)->first()) {
         return $authUser;
     }
     return User::create(['name' => $user->name, 'email' => $user->email, 'github_id' => $user->id, 'avatar' => $user->avatar, 'token' => $user->token]);
 }
示例#2
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 public function create(array $data)
 {
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }