Skip to content

Eager Loading Polymorphic Nested Relations. #14119

Closed
@pvormittag

Description

@pvormittag

PR #13737 describes the ability to eager load polymorphic nested relations, but the nested relation will still be ignored when using the with method.

// This will eager load the `likeable` relation, but not the `likeable.owner` relation.
Foo::with(['likeable.owner'])->get()

The above example does work if you place $with = ['likeable.owner'] on the Foo model, however the relation will always be eager loaded, which is not ideal for all use cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions