I have a command which should be run in scheduler. This command depends on an env variable which is set from vhosts for web requests.
For commands, it requires to set a specific value. Why not I directly pass the value as parameter?
Because, that env is used by Laravel in bootstrapping steps.
To be specific, that env variable contains the module name. Based on that, Laravel bootraps correct module(routes, controllers, views etc).
I need to run this command for a specific module. So from terminal I can Module=module1 php artisan mycommand
Now I need to run that command everyday. So I want to use Laravel scheduler. But there I only need to put the command name mycommand
. Is there any way to set the env?