Reputation: 704
I am trying to figure out how to write my algolia
search index, in my laravel .env
file.
I have tried using public $indices = env('ALGOLIA');
But it doesn't work.
i have of course written ALGOLIA=some_index
in my .env
file.
So how can i make $indices
accept a environment variable?
Upvotes: 0
Views: 315
Reputation: 13562
The .env
variables just overwrite the config variables.
Declare your variable in a given config file or create a new one (Google for a new one). Then you can direct to the .env
ironment file.
app.php
'algolia' => env('ALGOLIA')
.env
ALGOLIA=123
You then call it with Config::get('app.algolia');
.
Upvotes: 2