|
12 | 12 | namespace Barryvdh\LaravelIdeHelper\Console; |
13 | 13 |
|
14 | 14 | use Barryvdh\LaravelIdeHelper\Factories; |
| 15 | +use Dotenv\Parser\Entry; |
| 16 | +use Dotenv\Parser\Parser; |
15 | 17 | use Illuminate\Console\Command; |
16 | 18 | use Illuminate\Contracts\Config\Repository; |
17 | 19 | use Illuminate\Contracts\View\Factory; |
18 | 20 | use Illuminate\Filesystem\Filesystem; |
19 | 21 | use Illuminate\Support\Collection; |
| 22 | +use Illuminate\Support\Env; |
20 | 23 | use RuntimeException; |
21 | 24 | use Symfony\Component\Console\Input\InputOption; |
22 | 25 | use Symfony\Component\Console\Output\OutputInterface; |
@@ -208,7 +211,7 @@ protected function getExpectedArgumentSets() |
208 | 211 | return (string) $value; |
209 | 212 | })->toArray(), |
210 | 213 | 'translations' => $this->loadTemplate('translations')->filter()->keys()->toArray(), |
211 | | - 'env' => array_keys($_ENV), |
| 214 | + 'env' => $this->getEnv(), |
212 | 215 | ]; |
213 | 216 | } |
214 | 217 |
|
@@ -334,6 +337,16 @@ protected function getOptions() |
334 | 337 | ]; |
335 | 338 | } |
336 | 339 |
|
| 340 | + protected function getEnv() |
| 341 | + { |
| 342 | + $parser = new Parser(); |
| 343 | + $entries = $parser->parse(file_get_contents(base_path('.env'))); |
| 344 | + |
| 345 | + return collect($entries)->map(function (Entry $entry) { |
| 346 | + return $entry->getName(); |
| 347 | + }); |
| 348 | + } |
| 349 | + |
337 | 350 | /** |
338 | 351 | * Remove our custom autoloader that we pushed onto the autoload stack |
339 | 352 | * |
|
0 commit comments