Retrieve values from .env
file
env('APP\_DEBUG');
// with default value
env('APP\_DEBUG', false);
Determine current environment
use Illuminate\Support\Facades\App;
$environment = App::environment();
Accessing configuration values using "dot" syntax
// config/app.php --> ['timezone' => '']
$value = config('app.timezone');
// Retrieve a default value if the configuration value does not exist...
$value = config('app.timezone', 'Asia/Seoul');
Set configuration values at runtime:
config(['app.timezone' => 'America/Chicago']);
Comments