Use env() helper by invoking Dotenv\Dotenv directly#191
Use env() helper by invoking Dotenv\Dotenv directly#191paxperscientiam wants to merge 2 commits into
Conversation
…ently of framework.
mattstauffer
left a comment
There was a problem hiding this comment.
Quick note about a typo.
In terms of this general idea, I would think this is an OK way to do it, although it would be worth a later PR that also showed how to hook that into the application like happens in Laravel? If you can't do that, could you at least create an issue for it? But once you fix this typo this is good to merge--thanks so much!
Co-authored-by: Matt Stauffer <mattstauffer@users.noreply.github.com>
|
It appears that in the full installation of Laravel Unfortunately, "... although it would be worth a later PR that also showed how to hook that into the application like happens in Laravel" So, I could definitely try this, but where should it go? One thing that perplexes me, and this is probably related to laravel's boot code and not using Any ideas on how to address this? EDIT: I'm gonna check if your Slim Application can be used to do likewise...brb
EDIT3: @mattstauffer , lemme know if you think it would be better to create a new issue based on the above text. EDIT4: hold off on merging. got something figured out. EDIT5: see issue #192 |



Hey
I've provided an example of how to use the
env()helper in conjunction with direct leverage of the Dotenv\Dotenv library. Unfortunately, the values aren't accessible withIlluminate\Support\Env; not sure what the missing bit is.That said, maybe it's not important. IIRC, laravel folks say to only rely on app environment variables in the config files.
Thoughts?