Skip to content

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

Open
@MattKunX

Description

@MattKunX

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions