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.
An example of what I'm trying to achieve:
if (in_array($request->input('value'), config('app.valid_values')) {
// do something
}
This valid_values
is simply an array of values. It's of arbitrary length, so you can't just set them in your .env
file like:
VALID_VALUE1=...
VALID_VALUE2=...
etc.
AND the array needs to be different for each environment.
This was easy to do in Laravel 4 with environment configuration folders. But how do you do this with Laravel 5?
See Question&Answers more detail:os