/**
  * getSocialData Pass the user details to signup form
  *
  * @param  $userData
  * @param  $provider
  */
 protected function getSocialData($userData, $provider)
 {
     $array = ['username' => $userData->getNickname(), 'email' => $userData->getEmail(), 'facebookID' => 0, 'twitterID' => 0, 'githubID' => 0];
     $array[$provider . 'ID'] = $userData->getId();
     if ($userData->getNickname() === null) {
         $array['username'] = Str::slug($userData->getName());
     }
     $user = User::create($array);
     if ($user) {
         $this->createAvatar($array['username'], $userData->getAvatar());
         Auth::loginUsingId($user->id, true);
         return $this->userHasLoggedIn();
     }
 }
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return \Illuminate\Support\Collection
  */
 protected function create(Request $request)
 {
     return User::create(['username' => $request->username, 'email' => $request->email, 'password' => bcrypt($request->password), 'facebookID' => 0, 'twitterID' => 0, 'githubID' => 0]);
 }
Esempio n. 3
0
 /**
  * Create test user
  *
  * @return \Illuminate\Support\Collection
  */
 public function createUser()
 {
     return User::create(['username' => 'testuser', 'email' => '*****@*****.**', 'password' => bcrypt('testpassword'), 'facebookID' => 0, 'twitterID' => 0, 'githubID' => 0]);
 }