예제 #1
0
 /**
  * @param \Laravel\Socialite\Contracts\User $userData
  * @return User
  */
 public function findByUsernameOrCreate($userData)
 {
     $user = User::firstOrCreate(['username' => $userData->getNickname(), 'email' => $userData->getEmail()]);
     $user->full_name = $userData->getName();
     $user->save();
     return $user;
 }
 /**
  * @param $username
  * @return bool
  */
 public function setDenied($username)
 {
     $uid = User::query()->where('username', $username)->first(['id'])->id;
     $volunteer = Volunteer::query()->where('user_id', $uid)->firstOrFail();
     $volunteer->pending = false;
     return $volunteer->save();
 }
예제 #3
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }