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
In both cases, the OneTable2AnotherTable pivot's mutator is called and the respective exception is therefore thrown.
Note that this doesn't happen when getting a regular non-pivot model or a regular model's related models defined via hasMany().
The text was updated successfully, but these errors were encountered:
ghost
changed the title
Custom pivot's mutator called when eager-loading belongsToMany() relationship
Custom pivot's mutator called when getting belongsToMany() relationship
Feb 20, 2018
Description:
Getting or eager-loading a
belongsToMany()
relationship causes any defined custom pivot's mutators to be called.Steps To Reproduce:
Create two simple models with a custom pivot that has a mutator:
Get a
OneTable
instance and its relatedAnotherTable
s:Or eager-load its related
AnotherTable
s:In both cases, the
OneTable2AnotherTable
pivot's mutator is called and the respective exception is therefore thrown.Note that this doesn't happen when getting a regular non-pivot model or a regular model's related models defined via
hasMany()
.The text was updated successfully, but these errors were encountered: