APPNETOS is under active development This website and its documentation are being prepared for public launch. Content and features may change.
Select Theme
Loading

Env

Runtime and configuration value injection.

Purpose & processing

Reads the environment value from $_ENV first, then getenv().

Parameters

Parameter Type Default Behavior
key string Required Key used to resolve the value.

Example

#[Env('APP_ENV')]
protected string|null $environment = null;

Behavior and considerations

  • A non-null $_ENV entry takes precedence.
  • If getenv() returns false or neither source contains a value, null is injected.
  • Values are not automatically coerced to another type.

Source

shared/src/Core/Annotation/Env.php

Next Steps

Previous

Config

Explore Config

Next

Runtime

Explore Runtime