I have a faily complex data structure:
Event: top-level object
|-Streams: events can contain multiple streams of information / data capture
|-Datacapture: each stream can have up to 4 datacapture records
|-Overlay: each stream can have many overlays
| |-Frames: each overlay can have many frames
|-Background: each stream can have many backgrounds
| |-Frames: each background can have many frames
|-Experiences: each stream can have up to 6 experiences
|-Selectors: each experience can have many selectors
|-Filters: each selector can have one filter
|-Props: each selector can have one prop (whether it has a filter or no)
| |-Frames: each prop can have many frames
|-Overlay: each selector can have one overlay
| |-Frames: each overlay can have many frames
|-Background: each selector can have one background
| |-Frames: each background can have many frames
This is just a piece of the puzzle -- there are more objects attached to experiences and streams, but I think this gives the gist.
What I wish to do, ideally, is create a single eager-load query that can load and return the complete EVENT collection with all of it's constituent parts.
I know I can eager load multiple relationships with with(['blah','plop']) and that I can load nested relationships with with('blah.plop') and I can even load multiple nested relationships with with(['blah.plop','blah.somethingelse']), however my situation is obviously more complex.
I want to AVOID loading each "sub-relationship" separately like
$event = event::with([
'streams.datacaptures',
'streams.overlay.frames',
'streams.background.frames',
'streams.experiences.selectors.filters',
'streams.experiences.selectors.props.frames',
'streams.experiences.selectors.overlay.frames',
'streams.experiences.selectors.background.frames'
])->find($eventcode);
Is there something neater / cleaner I can do?