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
When using the ->whenPivotLoaded method on a Resource where the underlying Eloquent model has aliased the pivot accessor with ->as('accessor') no value is returned. ConditionallyLoadsAttributes.php only tries to access the pivot table using ->pivot which is null after changing the accessor.
Steps To Reproduce:
Create two models in a many-to-many relationship.
Eager load the relationship.
Change the accessor of the pivot table with the ->as() method.
Create a Resource and return a value based on whenPivotLoaded
The text was updated successfully, but these errors were encountered:
Description:
When using the
->whenPivotLoaded
method on a Resource where the underlying Eloquent model has aliased the pivot accessor with->as('accessor')
no value is returned.ConditionallyLoadsAttributes.php
only tries to access the pivot table using->pivot
which is null after changing the accessor.Steps To Reproduce:
Create two models in a many-to-many relationship.
Eager load the relationship.
Change the accessor of the pivot table with the
->as()
method.Create a Resource and return a value based on
whenPivotLoaded
The text was updated successfully, but these errors were encountered: