Back

The forgotten production()

🧭

Is this package for you?

17 reasons, each a before and an after. Select the problems you have and see how many match.

Take the scorecard
🚧

A placeholder nobody filled in

env-settings:make writes '' and 0 with a // TODO next to them. Nothing ever complained when one stayed that way. The class resolved to an empty domain and a zero timeout, the application booted, and the failure surfaced later somewhere unrelated — the exact bug this package exists to prevent, one layer further in.

env-settings:check turns that into a build failure.

env-settings:check --env=production exit 1
✗ App\Settings\AuthSettings
    domain                   empty string, but set in development()
    timeout                  0, but set in development()
    webhook_url              still contains "TODO"

1 of 6 classes incomplete for [production]: 3 values to fill in.
Mark a property #[AllowEmpty] if its empty value is intentional.

CI stops here — the empty domain never reaches production.

env-settings:check --env=production exit 0
[ production ] — 5 settings classes complete.

This demo, right now — development, staging, testing and production all pass.

What counts as a placeholder

'' 0 0.0 false [] null

Plus any string containing TODO, in any casing — the marker env-settings:make leaves behind.

Scope it however you need

env-settings:check --env=production
env-settings:check
env-settings:check "App\Settings\AuthSettings"

A named environment, the current APP_ENV, or a single class.

🔍

A placeholder alone proves nothing

retry_attempts: 0 may be exactly what every environment wants. A value is only reported when another environment supplies a real one for the same property — the shape of a class where one factory was filled in and another forgotten.

A useful consequence, found while building this page: a freshly generated class where every factory is still a placeholder reports as complete. There is no filled-in sibling to compare against yet. The check catches the environment you forgot, not the class you have not started.

🤫

When empty is the answer

Turning this check on flagged a value in the demo that was never wrong:

✗ App\Settings\NotificationSettings
    sandbox_mode             false, but set in development()

Sandbox mode is deliberately off in production — not a placeholder anyone forgot. One attribute says so:

#[AllowEmpty] public bool $sandbox_mode,

The check goes quiet; env-settings:diff still reports sandbox_mode * | true | false. Silencing the gate never hides the difference.

Wire it into CI

It exits non-zero when anything is incomplete, so it is a gate rather than a report — no extra plumbing required.

# .github/workflows/ci.yml
- name: Verify settings are complete
  run: php artisan env-settings:check --env=production
Read the command docs Enum-valued settings Masking sensitive values All four commands #[Environment] In tests Overrides Is this for you? Back to the demo