1

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.

2
  • Try: \rias\scout\ScoutIndex::create(getenv('SCOUT_INDICES'))
    – Brad Bell
    Apr 8 '20 at 21:04
  • Thank YOU!!! That Worked!
    – JBrew30
    Apr 8 '20 at 21:34
2

If you use this, it should work:

\rias\scout\ScoutIndex::create(getenv('SCOUT_INDICES'))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.