Level 102
Upgrade to 6 and check this article.
https://laravel-news.com/eloquent-subquery-enhancements
Or install this package
https://github.com/reinink/advanced-eloquent
Or read this article by the author to see how to add them manually.
https://reinink.ca/articles/dynamic-relationships-in-laravel-using-subqueries