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
Merged

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

merged 2 commits into from May 24, 2019

Conversation

jasonlbeggs
Copy link
Contributor

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
@seriquynh
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants