WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Eager loading morphTo() relationships with withTrashed() does not include soft-deleted models. The MorphTo::getResultsByType() method in the MongoDB implementation doesn't replay macros (including withTrashed()), causing soft-deleted related models to be excluded from eager-loaded results.
The eager-loaded morphToSoftWithTrashed relationship should return the soft-deleted Soft model instance, matching Laravel's standard Eloquent behavior.
Actual behaviour
The eager-loaded relationship returns null instead of the soft-deleted model.
Potentially a duplicate of #1361, but the fix does not work