Skip to content

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

Merged
taylorotwell merged 2 commits intolaravel:5.8from
jasonlbeggs:jlb-add-app-is-production
May 24, 2019
Merged

[5.8] Add app()->isProduction helper and tests#28602
taylorotwell merged 2 commits intolaravel:5.8from
jasonlbeggs:jlb-add-app-is-production

Conversation

@jasonlbeggs
Copy link
Copy Markdown
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
@oliverquynh
Copy link
Copy Markdown
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.

3 participants