Nov 3, 2015
0
Level 1
Accessing the App's URL from Console Commands
Hi All,
I'm trying to use the route() helper function in a class that is used by both a controller and a console command. However, when it is called by the command, it is unable to find the URL of my app.
In full Laravel this would be as easy as setting the app.url config option, but my Lumen app is currently only using a .env file for its configuration. Is there an option available I could use in the .env file? Do I need to switch to using full config files? Or can I set it by doing something like this in the app's bootstrap?
Config::set('app.url', env('APP_URL'));
Thanks for your help!
Please or to participate in this conversation.