get(); } elseif (isset($_GET["gameJamId"])){ $regs = Registration::where("game_jam_id", $_GET["gameJamId"])->get(); }elseif (isset($_GET["gameDataId"])){ $regs = Registration::where("game_data_id", $_GET["gameDataId"])->get(); }else{ $regs = Registration::all(); } header("Access-Control-Allow-Methods: GET"); header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept"); header('Content-Type: application/json;charset=UTF-8'); echo json_encode(array('data' => $regs->jsonSerialize()));