laravel 8 — send concurrent requests using guzzle 7

Recently I was working on a project where I was sending ~15 requests to external APIs, each of which took ~1s meaning that the total request time until the user received a response was around 15 seconds.

I wanted to make this faster so I researched sending these external requests concurrently and was able to reduce the total response time to ~1 second. This is an example of what I did:

Create a fresh project:

laravel new concurrent_requests_example