Skip to content
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

illuminate/collections 12.x dev branch has non-included dependencies #55270

Closed
DanielCHood opened this issue Apr 3, 2025 · 10 comments
Closed

Comments

@DanielCHood
Copy link

DanielCHood commented Apr 3, 2025

Laravel Version

12.x

PHP Version

8.3

Database Driver & Version

No response

Description

When using illuminate/collections separately from the framework, illuminate/collections@4ee8d36 introduced a dependency on Illuminate\Http\Resources\TransformsToResourceCollection which is not included if you are using the package directly

Steps To Reproduce

Update illuminate/collections to use the 12.x branch.
new \Illuminate\Support\Collection([]) will error.

PHP Fatal error:  Trait "Illuminate\Http\Resources\TransformsToResourceCollection" not found in /___/vendor/illuminate/collections/Collection.php on line 23"
@damiantw
Copy link

damiantw commented Apr 3, 2025

This broke deploys with vapor CLI

@Engazan
Copy link

Engazan commented Apr 3, 2025

yea it broke new installation with laravel new command

PHP Fatal error:  Trait "Illuminate\Collections\Traits\TransformsToResourceCollection" not found in ...\AppData\Roaming\Composer\vendor\illuminate\collections\Collection.php on line 23

he need to change namespace to namespace Illuminate\Support\Traits; -> illuminate/collections@0d084ab#comments

@Atif-MyEdSpace
Copy link

Lol pls fix vapor <3

@skinnyandbald
Copy link

skinnyandbald commented Apr 3, 2025

We can't deploy anything to Vapor. JFC.

UPDATE - in case useful for others

We've resolved it in the meantime, by pinning the stable version within our CI GitHub Action

      - name: Pin illuminate/collections to stable version (Laravel bug #55270 workaround)
        run: composer global require illuminate/collections:^10.0

@driesvints
Copy link
Member

Does it help with the new v12.7.1 fix which was released?

@taylorotwell
Copy link
Member

This was fixed in illuminate/collections 12.7.1.

@alexstojda
Copy link

It was fixed in illuminate/collections 12.7.2 (not 12.7.1)

@thewebdevelopers
Copy link

This was fixed in illuminate/collections 12.7.1.

This was introduced in 12.7.1.

It's now fixed, thanks.

@driesvints
Copy link
Member

We pushed another fix in v12.7.2, thanks all!

@taylorotwell
Copy link
Member

Sorry everyone!

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

No branches or pull requests

9 participants