-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.6.8] Not able to use tightenco/collect #23420
Comments
Could someone help me understand why |
We're declaring that we're incompatible with the older (<5.5.33) version of tightenco/collect since that version was using identical namespaces and class names as Laravel provided. It's not being pulled into your project by the root composer.json file, but the spatie/crawler project. So, the tightenco/collect package declare helpers that are not compatible with Laravel. I believe the current stance is that this is someone else's fault. They shouldn't use our function names. Booo them! Booo! #20370 laravel/ideas#709 On a more serious note, the only way around this is to namespace/prefix all our helpers with something relevant. We cannot control what third party code is declaring, but we can reduce the area of conflict. Another problem is that we're conditionally defining the helper functions. This means that the code doesn't fail in helpers.php, but instead later when someone discovers that the function they called wasn't the one they intended to call. |
The clarify, the problem is not that we're declaring a conflict in our composer.json file, that doesn't pull down the tightenco/collect package. You get it because you're installing spatie/crawler with depends on it. The problem is that you've got a package that has conflicting helpers. That's not allowed. Boo! |
FWIW, we consider this an issue that collect and the collect team are are taking the responsibility to fix. If it requires a change at the framework level we will attempt to PR it but I believe it won’t. |
I installed a captcha package for Laravel and got the exact same problem. |
@mattstauffer any updates/ETA on this, we'd really like to use spaties mixed-content-scanner ;-) |
@repat Please see tighten/collect#92 , a fix is released. |
@mpociot this issue can be closed i guess :) |
Yeah - this is now fixed in 5.6.12 of tightenco/collect - https://github.com/tightenco/collect/releases/tag/v5.6.12 |
Description:
Because we now treat
tightenco/collect
as a conflict (PR #23379) composer installs both packages and adds them to the autoloader.The problem is that the autoloader sequence is wrong and puts
tightenco/collect
in front, therefore loading thetightenco/collect
helper methods instead of Laravel's helpers.Because of this, the wrong collection classes will be passed internally:
Steps To Reproduce:
laravel new testapp cd testapp composer require spatie/crawler open http://testapp.test
See error:
The text was updated successfully, but these errors were encountered: