I have a 'laravel' server on the back end over time one of my API calls became very long
follow sample:
$tempRelatorios->RelatoriosZero = $this->RelatoriosZero($request);
$request->merge(['tipo' => 'vinculou']);
$tempRelatorios->RelatoriosUm = $this->RelatoriosUm($request);
$tempRelatorios->RelatoriosDois = $this->RelatoriosDois ($request);
$tempRelatorios->RelatoriosTres = $this->RelatoriosTres ($request);
$tempRelatorios->RelatoriosQuatro = $this->RelatoriosQuatro($request);
I would like to know if it would be possible to call these functions asynchronously(RelatoriosUm , RelatoriosDois ,etc) I can't make multiple api calls, all the answer needs to be in a single Json.
I imagine that the response time of this route could be much better if I ran all these functions simultaneously , in the end wait for them all to finish and send them in a return
return response()->json($tempRelatorios);
thank you so much who can help :)