public function handleProviderCallback() { $char = Socialize::with('eveonline')->user(); try { $user = User::where('char_id', $char->id)->firstOrFail(); } catch (ModelNotFoundException $e) { $user = User::createAndFill(['char_id' => $char->id, 'char_name' => $char->name, 'password' => Userbot::generatePassword(16), 'next_check' => \Carbon\Carbon::now('UTC')]); } Auth::login($user, true); return redirect('home'); }
/** * @return array */ public function listUnregistered() { $users = User::where('slack_id', null)->get(); return $users; }
/** * @param string $email * * @return User */ public static function findByEmail($email) { return User::where('email', $email)->firstOrFail(); }