Answers.Body: <p>If you use this, it should work:</p>
  
  <pre><code>\rias\scout\ScoutIndex::create(getenv('SCOUT_INDICES'))
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-09T04:49:04.200Z
Answers.LastActivityDate: 2020-04-09T04:49:04.200Z
Answers.UserDisplayName: Brad Bell
Body: <p>I was wondering if it was possible to add .env variable for the indices area in the scout.php file?</p>
  
  <p>I added this to my .env file</p>
  
  <pre><code>SCOUT_INDICES = "search_SCOUT_DEV"
  </code></pre>
  
  <p>Then this to my scout.php</p>
  
  <pre><code>\rias\scout\ScoutIndex::create('getenv(varname:’SCOUT_INDICES’)”)
  </code></pre>
  
  <p>To replace </p>
  
  <pre><code>\rias\scout\ScoutIndex::create('search_SCOUT')
  </code></pre>
  
  <p>Which is my Prod indices. It did not work. </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-08T21:04:59.020Z
Comments.Text: Try: `\rias\scout\ScoutIndex::create(getenv('SCOUT_INDICES'))`
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-08T21:34:57.097Z
Comments.Text: Thank YOU!!! That Worked!
Comments.UserDisplayName: JBrew30
Tags: <craft3><plugin-craftcommerce>
Title: Environmental variables for Scout plugin in scout.php file
ThreadText: # Environmental variables for Scout plugin in scout.php file
  
  (Asked by: username_0 on 2020-04-08)
  
  I was wondering if it was possible to add .env variable for the indices area in the scout.php file?
  
  I added this to my .env file
  
  ```
  SCOUT_INDICES = "search_SCOUT_DEV"
  
  ```
  
  Then this to my scout.php
  
  ```
  \rias\scout\ScoutIndex::create('getenv(varname:’SCOUT_INDICES’)”)
  
  ```
  
  To replace
  
  ```
  \rias\scout\ScoutIndex::create('search_SCOUT')
  
  ```
  
  Which is my Prod indices. It did not work.
  
  **Tags:** craft3, plugin-craftcommerce
  
  > **Comments:**
  > **username_1**: Try: `\rias\scout\ScoutIndex::create(getenv('SCOUT_INDICES'))`  
  > **username_0**: Thank YOU!!! That Worked!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-04-09. Score: 2 | Accepted answer
  
  If you use this, it should work:
  
  ```
  \rias\scout\ScoutIndex::create(getenv('SCOUT_INDICES'))
  
  ```
  
  
  ---
  
  