Skip to content
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

[5.8] Add app()->isProduction helper and tests #28602

Merged
merged 2 commits into from May 24, 2019

Conversation

Projects
None yet
3 participants
@jasonlbeggs
Copy link
Contributor

commented May 24, 2019

This PR adds an isProduction() helper to match the isLocal and runningUnitTests helpers as these are the most common environments in use.

I also added tests for those three methods.

@jasonlbeggs jasonlbeggs changed the title Add app()->isProduction helper and tests [5.8] Add app()->isProduction helper and tests May 24, 2019

@xuanquynh

This comment has been minimized.

Copy link
Contributor

commented May 24, 2019

Do you think it's helpful to support environment aliases? For example, if APP_ENV is prod, app()->isProduction() will return true.

I experience one case in Symfony Framework. I have to use dev, test and prod environments. Some developers may prefer these values. But if these aliases are used in Laravel, all methods isProduction(), isLocal() and runningUnitTests() don't work properly.

@taylorotwell taylorotwell merged commit 71577f1 into laravel:5.8 May 24, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.