Hey guys, i want to be able to get a json data from a externe api and convert it to xml using my api call and my methode in my controller . but i don't know how to tackle this.
( i currently have my route like this)
in my api/route
Route::get('CustomApiUrl', ApiController::class);
Route::post('CustomApiUrl', ApiController::class);
and this is the methode i want to use to convert json to xml from the requested custom url(route).
// i think it looks like this but not sure.
public function index()
{
$data= data;
$result = ArrayToXml::convert($data, 'config', true, 'UTF-8');
return response($result)->header('Content-Type', 'text/xml');
}
so i want to be able to get the data from an externe api (customapiRouteURL) and convert the xml using my api call.