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

Conflict with Laravel using Composers autoloader, specifically the __() (trans) helper function. #46

Open
MattKunX opened this issue May 2, 2024 · 0 comments

Comments

@MattKunX
Copy link

MattKunX commented May 2, 2024

The Laravel '__' check if (!function_exists('__')) { on line 92 of Lodash.php is insufficient for preventing a conflict. Specifically, when using the composer autoloader, your module can be loaded first, overriding the creation of Laravel's __() (trans) function.

I encountered this issue when running composer install on a fresh staging environment, which broke all calls to __().

This problem arose because your lodash-php module was included in a module built for Laravel. While I understand that your module is not specifically built for Laravel and the responsibility lies with the including party, and a workaround is to always manually install lodash-php or the module including it afterwards. I noticed the Laravel comment about compatibility and wanted to bring this to your attention.

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

1 participant