If you need to create an array on values, you can create on string format and when you need you can parse them
MY_ARRAY_VALUE=1,2,house,cat,34234
When you need them
$myArrayValue = explode(',', env('MY_ARRAY_VALUE'));
Or save your values in JSON and get them with json_decode()
$myArrayValue = json_decode(env('MY_ARRAY_VALUE'), true);
Extra info:
On Laravel 5, you need to translate all your configs files in one .env file.
On each environment your .env
file will be diferent with values for this environment.
To set your environment, you need to change the value of APP_ENV
in your .env
file
APP_ENV=local
And you can create your own variables in that file
https://laravel.com/docs/5.2/configuration#environment-configuration
This is an extract of the upgrade guide to Laravel 5.0
https://laravel.com/docs/5.2/releases#laravel-5.0
Instead of a variety of confusing, nested environment configuration directories, Laravel 5 now utilizes DotEnv by Vance Lucas. This library provides a super simple way to manage your environment configuration, and makes environment detection in Laravel 5 a breeze. For more details, check out the full configuration documentation.
You can find a default .env
file here: https://github.com/laravel/laravel/blob/master/.env.example
It is often helpful to have different configuration values based on the environment the application is running in. For example, you may wish to use a different cache driver locally than you do on your production server. It's easy using environment based configuration.
To make this a cinch, Laravel utilizes the DotEnv PHP library by Vance Lucas. In a fresh Laravel installation, the root directory of your application will contain a .env.example file. If you install Laravel via Composer, this file will automatically be renamed to .env. Otherwise, you should rename the file manually.