laravellumen

Change environment file path in Lumen


I want to change default .env file path to another one (for usage in production).

In base laravel application I can do this through editing bootstrap/app.php file with adding

$app->useEnvironmentPath(...);

But Lumen Application class implementation does not support this method

I found solution for public folder path editing through

$app->bind('path.public', function() { 
    return __DIR__; 
});

in public/index.php, but I can't find something like path.env(ironment).

Help me please with this problem


Solution

  • I'm lazy. Didn't saw at the top of Lument bootstrap/app.php file next line of code

    Dotenv::load(__DIR__.'/../');
    

    And there we can set any .env file location what we prefer