name = $_POST['gameJamName']; $gameJam->start_time = $_POST["startDate"]."T".$_POST["startTime"]; $gameJam->end_time = $_POST["endDate"]."T".$_POST["endTime"]; if (!empty($_POST['keyWord'])) { $gameJam->key_word = $_POST['keyWord']; }else{ $gameJam->key_word = null; } $gameJam->description = $_POST['description']; if ($gameJam->save()) { http_response_code(201); }else{ http_response_code(500); } }else{ http_response_code(400); echo json_encode(["message" => "game jam not found"]); } }else{ http_response_code(400); } }else{ http_response_code(401); echo json_encode(["message" => "is not admin"]); }