I have a question, i got a collection by ->get() eloquent query. I need to know the maximum of relationship possible for elements in my collection.
I have multiples invoices, and i would like to know the maximum of payments done for one invoices.
I think a solution by doing map function and parse raw by raw and take the count of relationship each time and keep the maximum, but i think this is not really optimized.
Do you have an idea ?