L
L
Lucius Mooning2018-06-04 14:58:09
Laravel
Lucius Mooning, 2018-06-04 14:58:09

How to get a collection of related elements to a collection of parent objects?

Good afternoon!
How to get a collection of related elements to a sorted collection of parent objects?
For example,
A -> hasMany (B) -> hasOne(C)
Initial data: an instance of class A.
I get a collection B for element A: A->B()
I want to get: a collection of C elements for all B bound to A, preferably in 1-2 lines, without going through the foreach loop on B.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question