Support the ongoing development of Laravel.io →
Laravel Configuration IOC
  • Laravel Version: 5.4.33
  • PHP Version: 7.0.22-0ubuntu0.16.04.1
  • Database Driver & Version: 10.1.25-MariaDB-1~xenial

Description:

I've been reading different ways of doing this, but none of the solutions seem to be working. At some point in my app, I want to be able to add an .env editor, and in my .env is a path to my preferred storage location. (e.g /data/dev/storage)

What is the best way to use the useStoragePath method, but to also call the .env value that is the path? (e.g env('APP_STORAGE'))

Steps To Reproduce:

Tried $this->app->useStoragePath(env('APP_STORAGE')); in AppServiceProvider::register - no changes

Tried $app->useStoragePath(env('APP_STORAGE')); in bootstrap/app.php - can't pull env value

Tried $app->useStoragePath('/my/preferred/path'); in bootstrap/app.php - this worked, but was not my preferred option.

Any ideas?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

TechKat techkat Joined 19 Oct 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.