In Laravel 4, you could set an environment based config folder structure:
/config/app.php
/config/dev/app.php
/config/staging/app.php
/config/testing/app.php
Can you do this with Laravel 5? I understand the .env
concept and I'm using that to define which environment I'm in. But I need to define a config value that is an array of arbitrary length, and you can't do that with .env
files.
我正在努力实现的一个例子:
if (in_array($request->input('value'), config('app.valid_values')) {
// do something
}
这valid_values
只是一个值的array.它的长度是任意的,所以您不能只在.env
文件中设置它们,如下所示:
VALID_VALUE1=...
VALID_VALUE2=...
etc.
而且每个环境的数组都需要不同.
在Laravel 4中,使用环境配置文件夹很容易做到这一点.但是你怎么用拉威尔5号做到这一点呢?