generated from open-southeners/php-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Replication example
Loading something twice as on a polymorphic relationship and somewhere else (included as of a nested relationship), imagine something like:
// PostController.php
public function index(JsonApiResponse $response)
{
return $response->using(Post::with([
'parent' => fn (MorphTo $morphTo) => $morphTo->morphWith([
Group::class => [
'createdBy', // this being user ID = 2
],
]),
'author', // this being user ID = 2
'author.avatars', // load avatars from post.author relationship thought groups will not have access to this!
]));
}This will get into a race condition where author relationship (in this case could be of type user) will be different sometimes at the included data array because the user is actually the same in both relationships...
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
In Progress