Laravel : Reaching nested relationship
Knowing the structure below, can I add a function to the Container class to get records directly with Container::with('records')->get() instead of Container::with('boxes.letter.records')->get() ? containers hasMany boxes hasOne letter hasMany records class Container extends Model { public function boxes(): hasMany {…