-
Notifications
You must be signed in to change notification settings - Fork 677
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
isInTestingEnvironment function is not working with php artisan config:cache #537
Comments
I cannot see why you would use |
Stripe Webhook controller is using that method.
|
@ivankolodii ah sorry, gotcha. But the same remark stands. On production this will simply default to false. |
You should fix this since caching configuration is a valid option in a testing environment. There is an issue on Windows Apache when using multiple projects under the same server. When one project is calling the api of a second project, the configuration of one project is read by the second project. Since the standard line to resolve this is "cache your config" then you should fix the problem here so I don't have to overwrite isInTestingEnvironment to not use getenv. "To clear things up; this is a known issue. It's just not documented. You must run php artisan config:cache in both Laravel projects to generate a cached configuration. This is a requirement for Apache on Windows (and many other setups)." laravel/framework#19990 If you attended Laracon 2018 then surely you heard when Taylor said to not call getenv() in your code. |
Heya @fbingha. Thanks for bringing this to my attention. I'll re-open this to have another look at a later time. In the meantime feel free to send in a PR which might be able to fix this. |
I've sent in a proposal which refactors the way we tackle this problem. Please have a look and let me know what you think: #591 |
The behavior for this has been changed in 9.0 which will be released soon. An upgrade guide will be provided. |
If you use
php artisan config:cache
this function will always return null according to https://laravel.com/docs/5.6/configuration#configuration-caching.Config file should be created and used via
config('cashier.env')
P.S. Still don't understand purpose of this function. Value
testing
should be used on production too.The text was updated successfully, but these errors were encountered: