Hello,
I have a three Eloquent Models which are Linked like this:
A HasMany B HasMany C
And I want to get all A's which have B's where the latest C is older than lets say 30 day.
There are multiple C's for a B and I am only interested in the latest (via created_at column)
Does anyone know how to fetch this data with a single SQL Statement?
I tried something like this but I don't know how I should structure the C Query part...
Hi Lary, thanks for your quick answer ;)
But this would only give me a C which is older than 30 days. But I want to ensure that the latest C is older than 30 days.