diff --git a/src/Illuminate/Foundation/Console/ServeCommand.php b/src/Illuminate/Foundation/Console/ServeCommand.php index 0c9cd9f5e6b1..83b5a068a86b 100644 --- a/src/Illuminate/Foundation/Console/ServeCommand.php +++ b/src/Illuminate/Foundation/Console/ServeCommand.php @@ -142,12 +142,12 @@ public function handle() */ protected function startProcess($hasEnvironment) { - $process = new Process($this->serverCommand(), public_path(), collect($_ENV)->mapWithKeys(function ($value, $key) use ($hasEnvironment) { + $process = new Process($this->serverCommand(), public_path(), collect($_ENV)->filter(function ($value, $key) use ($hasEnvironment) { if ($this->option('no-reload') || ! $hasEnvironment) { - return [$key => $value]; + return true; } - return in_array($key, static::$passthroughVariables) ? [$key => $value] : [$key => false]; + return in_array($key, static::$passthroughVariables); })->all()); $this->trap(fn () => [SIGTERM, SIGINT, SIGHUP, SIGUSR1, SIGUSR2, SIGQUIT], function ($signal) use ($process) {