-
Notifications
You must be signed in to change notification settings - Fork 2
use correct .env file #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- load env file based on environment set via --env, i.e. --env=something will load settings from .env.something - support Laravel 5.1 (tested with 5.3)
I'm not certain this is the correct and expected behavior of laravel apps, if you have a If you have a env var you wish to overwrite, you can always pass it into console like: $ MYSQL_HOST=testhost.dev php artisan db:seed-test --env=testing |
Hi,
Unfortunately , with unpatched server.php/bootstrap.. and/or setting shell variables it reads .env only
yes, but in case of scripting and hardly predicable config it ends in headache the other idea was to dynamically replace .env with .env.testing but it also can have not expected results (i.e. script breaks and original .env not returned back etc) so I end with such solution Well, probably there should be additional shell parameter to run my code, some like --force-correct-env-file to avoid running this part of code every time |
oh, I'm sorry, please forget this, seems Laravel 5.3. handles this by self , i.e. --env=testing loads correct .env file now. |
I've removed hack for reloading environment |
as far as i understand it, this now only updates the required laravel version, and adds some commented out lines, is this actually required? It works fine for us on a 5.1 laravel. |
Well, on 5.3. the so changing 'file' to 'files' is required also it seems 'files' are default name of facade starting from 5.0 |
got it - if you remove the commented out lines i will merge and release a new version, thanks for clarifying! |
I've removed anything unrelated (the function/var names don't affect functionality). seems not so much to merge :) |
these changes are needed to fix issue when command is called directly from console, i.e. if something like
is called, then script uses values from .env (and not from .env.testing)
so update forces use of a correct db via reloading environment/configuration based on passed value from --env