Laravel-Lang / publisher

Publisher provides functionality for working with application localization
https://laravel-lang.com/packages-publisher.html
MIT License
211 stars 25 forks source link

fixed lang_path function not exist in Lumen #310

Closed maxsky closed 1 year ago

andrey-helldar commented 1 year ago

Taylor officially recommends using Laravel, and we also prefer not to work with Lumen anymore.

You can solve your problem at the level of your application. Create a helper file and register it:

Step 1:

touch app/helper.php

Step 2:

// app/helper.php
if (! function_exists('lang_path')) {
    function lang_path(): string
    {
        return base_path('lang');
    }
}

Step 3:

// composer.json
{
    // ...
    "autoload": {
        // ...
        "files": [
            "app/helper.php"
        ]
    },
}

Step 4:

composer dumpauto

But thanks for your suggestion.

andrey-helldar commented 1 year ago

After thinking about your idea and looking at the project files, I will add the definition of this function to make the project work in the Lumen environment.

andrey-helldar commented 1 year ago

@maxsky, The function definition was released in version 14.4.0.

Perform a dependency update:

composer update