This is for a performance issue and the Laravel code base is straightforward to map to SQL. It is to get a rough idea of the joins and the filters to see if there is potentially an index missing.
This is low hanging fruit. ChatGPT can do this, and also easy to verify it got it right.