http_client = new Client([ 'base_uri' => 'https://api.curseforge.com/v1/', 'headers' => [ 'x-api-key' => config('curseforge.api_key'), ] ]); $this->minecraft_game_id = config('curseforge.minecraft_game_id'); $this->modpack_class_id = config('curseforge.minecraft_modpack_class_id'); } public function index() { $result = $this->http_client->get("mods/search?gameid=$this->minecraft_game_id&classid=$this->modpack_class_id&sortField=2"); if($result->getStatusCode() !== 200) { throw new DisplayException('Failed to fetch modpacks from CurseForge.'); } return $result->getBody()->getContents(); } public function show() { throw new NotImplementedException(); } public function install() { throw new NotImplementedException(); } }