Skip to content

[12.x] Fix ResourceCollection usage when used with an array instead of Model collection#58299

Merged
taylorotwell merged 2 commits into12.xfrom
12/issue-58297
Jan 7, 2026
Merged

[12.x] Fix ResourceCollection usage when used with an array instead of Model collection#58299
taylorotwell merged 2 commits into12.xfrom
12/issue-58297

Conversation

@crynobone
Copy link
Member

fixes #58297

Model collection

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
@crynobone crynobone marked this pull request as ready for review January 7, 2026 00:46
@taylorotwell taylorotwell merged commit ba269d0 into 12.x Jan 7, 2026
71 checks passed
@taylorotwell taylorotwell deleted the 12/issue-58297 branch January 7, 2026 00:47
kevalyq added a commit to SecPal/api that referenced this pull request Jan 7, 2026
Laravel 12.45.0 introduced a breaking change in ResourceCollection
handling (PR laravel/framework#58299). Collections created from
plain arrays no longer work correctly.

Fix: Wrap array in collect() to ensure proper Collection type.

Related: #479, #480, #481, #478 (Dependabot PRs)
kevalyq added a commit to SecPal/api that referenced this pull request Jan 7, 2026
Laravel 12.45.0 introduced a breaking change in ResourceCollection
handling (PR laravel/framework#58299). Collections created from
plain arrays no longer work correctly.

Fix: Wrap array in collect() to ensure proper Collection type.

Related: #479, #480, #481, #478 (Dependabot PRs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ResourceCollection throws "Call to a member function resolve() on array" error after upgrade to Laravel 12.45

2 participants

Comments