PHPackages                             surgems/env-condition - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. surgems/env-condition

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

surgems/env-condition
=====================

Statamic Tag that only displays it's content in a selected environment.

2.0.0(3y ago)085MITPHP

Since Jul 12Pushed 3y ago1 watchersCompare

[ Source](https://github.com/JacobTinston/StatamicEnvCondition)[ Packagist](https://packagist.org/packages/surgems/env-condition)[ RSS](/packages/surgems-env-condition/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Env Condition
=============

[](#env-condition)

> Env Condition is a Statamic Modifier that only displays it's content in a selected environment.

Features
--------

[](#features)

This addon does:

- Allows you to display content/fields based on the `APP_ENV`.

How to Install
--------------

[](#how-to-install)

You can use this addon by running the following command from your project root:

```
composer require surgems/env-condition
```

How to Use
----------

[](#how-to-use)

This addons uses 3 environments:

- local
- staging
- production

### Tag

[](#tag)

You can display content inside the tag depending on the condition of the `APP_ENV`.

There are 2 tag Methods:

```
{{ if_env env="local" }}
    {{ content | widont }}
{{ /if_env }}
```

This would display the content inside the tags if the `APP_ENV` IS 'local'.

```
{{ if_env:not env="local" }}
    {{ content | widont }}
{{ /if_env:not }}
```

This would display the content inside the tags if the `APP_ENV` IS NOT 'local'.

You can also add multiple parameters:

```
{{ if_env:not env="local|staging" }}
    {{ content | widont }}
{{ /if_env:not }}
```

This would display the content inside the tags if the `APP_ENV` IS NOT 'local' OR 'staging'.

### Modifier

[](#modifier)

You can display a field whenever the `APP_ENV` is a certain environment.

There are 2 modifiers:

```
{{ field | if_env:local }}
```

This would display the field content if the `APP_ENV` IS equal to 'local'.

```
{{ field | if_env_not:local }}
```

This would display the field content if the `APP_ENV` IS NOT equal to 'local'.

You can also add multiple parameters:

```
{{ field | if_env:local:staging }}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1405d ago

Major Versions

1.0.0 → 2.0.02022-07-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae7567e18ca3cfd7c4f9461e0bb86d55f203e15666d6f6853a3e8c6eb8dc4b55?d=identicon)[jacob.tinston](/maintainers/jacob.tinston)

---

Top Contributors

[![JacobTinston](https://avatars.githubusercontent.com/u/84318180?v=4)](https://github.com/JacobTinston "JacobTinston (2 commits)")

### Embed Badge

![Health badge](/badges/surgems-env-condition/health.svg)

```
[![Health](https://phpackages.com/badges/surgems-env-condition/health.svg)](https://phpackages.com/packages/surgems-env-condition)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
