$username, 'password' => $password ]; if (\Auth::attempt($credentials)) { return true; } else { return false; } } } /** * Returns information about the currently logged in username. * * If nobody is currently logged in, this method should return null. * * @return string|null */ public function getCurrentUser() { if (\Auth::id() > 0) { return \Auth::user()->username; } return null; } }