The env function retrieves the value of an environment variable or returns a default value:
$env env('APP_ENV');

$env env('APP_ENV''production');
        (new LoadEnvironmentVariables)->bootstrap($this->getAppMock('.env'));



        
$this->assertSame('BAR'env('FOO'));

        
$this->assertSame('BAR'getenv('FOO'));

        
$this->assertSame('BAR'$_ENV['FOO']);

        
$this->assertSame('BAR'$_SERVER['FOO']);
        $app['config']->set('database.connections.testbench', [

            
'driver' => 'mysql',

            
'host' => env('DB_HOST''127.0.0.1'),

            
'username' => 'root',

            
'password' => 'invalid-credentials',

            
'database' => 'forge',
{

    protected function 
setUp(): void

    
{

        if (! 
env('DYNAMODB_CACHE_TABLE')) {

            
$this->markTestSkipped('DynamoDB not configured.');

        }
    protected function getEnvironmentSetUp($app)

    {

        if (! 
env('DYNAMODB_CACHE_TABLE')) {

            
$this->markTestSkipped('DynamoDB not configured.');

        }
        $testConnection = new Memcached;



        
$testConnection->addServer(

            
env('MEMCACHED_HOST''127.0.0.1'),

            
env('MEMCACHED_PORT'11211)

        );
        $testConnection->addServer(

            
env('MEMCACHED_HOST''127.0.0.1'),

            
env('MEMCACHED_PORT'11211)

        );



        
$testConnection->getVersion();
            'phpredis' => $this->redis['phpredis']->connection(),

        ];



        
$host env('REDIS_HOST''127.0.0.1');

        
$port env('REDIS_PORT'6379);



        
$connections[] = (new RedisManager(new Application'phpredis', [
        ];



        
$host env('REDIS_HOST''127.0.0.1');

        
$port env('REDIS_PORT'6379);



        
$connections[] = (new RedisManager(new Application'phpredis', [

            
'cluster' => false,
    public function testDefaultConfiguration()

    {

        
$host env('REDIS_HOST''127.0.0.1');

        
$port env('REDIS_PORT'6379);



        
$predisClient $this->redis['predis']->connection()->client();
    public function testDefaultConfiguration()

    {

        
$host env('REDIS_HOST''127.0.0.1');

        
$port env('REDIS_PORT'6379);



        
$predisClient $this->redis['predis']->connection()->client();

        
$parameters $predisClient->getConnection()->getParameters();
    public function testUrl()

    {

        
$host env('REDIS_HOST''127.0.0.1');

        
$port env('REDIS_PORT'6379);



        
$predis = new RedisManager(new Application'predis', [
    public function testUrl()

    {

        
$host env('REDIS_HOST''127.0.0.1');

        
$port env('REDIS_PORT'6379);



        
$predis = new RedisManager(new Application'predis', [

            
'cluster' => false,
    public function testUrlWithScheme()

    {

        
$host env('REDIS_HOST''127.0.0.1');

        
$port env('REDIS_PORT'6379);



        
$predis = new RedisManager(new Application'predis', [
    public function testUrlWithScheme()

    {

        
$host env('REDIS_HOST''127.0.0.1');

        
$port env('REDIS_PORT'6379);



        
$predis = new RedisManager(new Application'predis', [

            
'cluster' => false,
    public function testScheme()

    {

        
$host env('REDIS_HOST''127.0.0.1');

        
$port env('REDIS_PORT'6379);



        
$predis = new RedisManager(new Application'predis', [