/** * Find Users by their Social Details * * @param string $email * * @return Collection */ public function findUserByProviderAndId($provider, $id) { $socialite = Socialite::where('provider', '=', $provider)->where('auth_id', '=', $id)->first(); if ($socialite) { return User::find($socialite->user_id); } return null; }
/** * Create a new user instance after a valid registration. * * @param array $data * * @return User */ protected function create(array $data) { return User::create(['username' => $data['username'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'firstname' => $data['firstname'], 'lastname' => $data['lastname']]); }
/** * Find Users by their Emails * @param string $email * @return Collection */ public function findUserByEmail($email) { return User::where('email', '=', $email)->first(); }