I want to configure the storage path in a Laravel 5.1 using the .env
file. My bootstrap/app.php
looks like this:
<?php
$app = new \Illuminate\Foundation\Application(
realpath(__DIR__.'/../')
);
$app->useStoragePath(getenv('STORAGE_PATH'));
and the relevant line in .env file is:
STORAGE_PATH=/var/www/storage
This doesn't work. I figured out the Dotenv library is initialised after the bootstrap is processed so the .env
variables are not available in bootstrap.php
.
Is there a different place where I can set the storage path and the .env
variables are available?