thiagocordeiro/laravel-translator

Conflict with lang function

Opened this issue · 1 comments

I'm using the package onecentlin/laravel-adminer and I have a conflict with this package.

FatalError PHP 8.2.3 9.52.6 Cannot redeclare lang() (previously declared in /var/www/html/vendor/thiagocordeiro/laravel-translator/src/Framework/helpers.php:9)

It seems that the laravel-translator package loads first and defines the function lang. Then, the package laravel-adminer tries to define the same function and as it loads after, it causes a fatal error.

I think that this package should check trough the configuration if in the functions section, the function lang is in the array of allowed functions. So, besides checking if function('lang') exists it should check if this function should be defined.

Hey @mbernet thanks for reporting the issue, I'm afraid you'll have to report the issue in onecentlin/laravel-adminer. As you can see at /src/Framework/helpers.php verifies whether the function was already declared before declaring it, pretty much what laravel does with its helper functions.

There should be another file which does not verify whether the funcion was already declared before declaring the function.