spatie / ray

Debug with Ray to fix problems faster
https://myray.app
MIT License
572 stars 101 forks source link

Multiple entries of the same collection resource not expandable/inspectable #853

Closed cornelRaiu closed 7 months ago

cornelRaiu commented 11 months ago

Describe the bug Having the same collection ( same resource id ) attached to different keys of another collection will only allow the first occurrence to expand.

Versions Ray version (you can see this in "About Ray"): 2.7.5

You can use composer show to get the version numbers of:

PHP version: Laravel version (if applicable): 8.1 and 8.2

To Reproduce Steps to reproduce the behavior:

  1. Create a collection and assign it to a variable:
$collection = collect([
    'a_key' => 'a_value',
    'another_key' => 'another_value',
]);
  1. Create a second collection with at least 2 keys having the $collection as value
collect([
    'entry_1' => $collection,
    'entry_2' => $collection,
])->ray();
  1. When checking the output in Ray, only entry_1 will be expandable/inspectable

Expected behavior I would expect to be able to expand all instances of the collection.

Additional context This doesn't happen in case you try to ray the collection twice in the same ray call like this:

ray($collect, $collect);

Screenshots image image

Desktop (please complete the following information):

spatie-bot commented 7 months ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.