Shift with red gradient lettering
Loading navigation...

env to config

Premium
Laravel
Performance

Convert calls to the env helper within your application to use the config helper with a new custom configuration file.

Before

if (env('APP_URL') === 'production') {
$value = env('CUSTOM_OPTION')
}

After

if (config('app.env') === 'production') {
$value = config('settings.custom_option')
}

← Back to the Workbench Tasks