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
{{ message }}
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
Shouldn't EnumeratesValues::getArrayableItems() check for Traversable before Jsonable? The Jsonable and JsonSerializable result in an array of stdClass objects where Traversable would preserve the correct class objects.
As a workaround, I'm currently having to call iterator_to_array when instantiating a Collection since the (3rd party) class I'm using only implements JsonSerializable and IteratorAggregate (Traversable).
The text was updated successfully, but these errors were encountered:
This seems like a feature request or an improvement so I'm moving this to the ideas repository instead. It's best to post these in the ideas repository in the future to get support for your idea. After that you may send a PR to the framework. Please only use the laravel/framework issue tracker to report bugs and issues with the framework.
Description:
Shouldn't
EnumeratesValues::getArrayableItems()
check forTraversable
beforeJsonable
? TheJsonable
andJsonSerializable
result in an array ofstdClass
objects whereTraversable
would preserve the correct class objects.https://github.com/laravel/framework/blob/8.x/src/Illuminate/Collections/Traits/EnumeratesValues.php#L923
As a workaround, I'm currently having to call
iterator_to_array
when instantiating aCollection
since the (3rd party) class I'm using only implementsJsonSerializable
andIteratorAggregate
(Traversable
).The text was updated successfully, but these errors were encountered: