Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
algolia私のlaravel.envファイルに検索インデックスを書き込む方法を見つけようとしています。
algolia
.env
public を使用してみましたが、うまくいき$indices = env('ALGOLIA');ません。私はもちろんALGOLIA=some_index私の.envファイルに書いています。
$indices = env('ALGOLIA');
ALGOLIA=some_index
$indicesでは、どうすれば環境変数を受け入れることができますか?
$indices
.env変数は構成変数を上書きするだけです。
特定の構成ファイルで変数を宣言するか、新しいものを作成します (新しいものは Google)。次に、.environment ファイルに移動できます。
app.php
'algolia' => env('ALGOLIA')
ALGOLIA=123
次に、で呼び出しますConfig::get('app.algolia');。
Config::get('app.algolia');