Shift with red gradient lettering

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

Sign in with any of the following services to connect Shift with your Laravel project.


Don't use one of these services?

Temporarily push your project to a free, private repository on one of these cloud-based services or upgrade your project locally with Shift for Docker.