-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty arrays aren't converted to Collections #810
Comments
We're running into the same issue. It looks like when the The main problem is that if you're relying on The easiest solution, as far as I can tell, is to re-enable the |
The issue here is not that we've removed Fixed in next release (108e660) |
Thank you, this is great news! |
✏️ Describe the bug
While creating an instance of a DTO that has a collection, if the source had an empty array, the returning property will be an empty array, instead of an empty Collection, resulting in the error message:
TestDTO::__construct(): Argument #1 ($items) must be of type Illuminate\Support\Collection, array given
.Line causing the issue
↪️ To Reproduce
✅ Expected behavior
I expect the test to complete, and the expectations to be satisfied.
🖥️ Versions
Laravel: 11.4
Laravel Data: 4.5.0
PHP: 8.3
The text was updated successfully, but these errors were encountered: