Skip to content

[5.2.34] MorphTo inside ::with() calls relation inside morphable entity too. #13770

Closed
@lelu85

Description

@lelu85

In that upgrade when you call a MorphTo inside the with model parameter like:

`
/**
* @var array
*/
protected $with = [
'OrderMorph'
];

/**
 * @return \Illuminate\Database\Eloquent\Relations\MorphTo
 */
public function OrderMorph()
{
    return $this->morphTo();
}

`

and the model is resolved, then it also calls the same relation OrderMorph inside the MorphTo entity so it leads to a Builder::MorphTo() not found.

If you revert to 5.2.33 it works.

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