diff --git a/src/Illuminate/Foundation/Console/ServeCommand.php b/src/Illuminate/Foundation/Console/ServeCommand.php index 84bcb05312a7..9c2cbc4056a1 100644 --- a/src/Illuminate/Foundation/Console/ServeCommand.php +++ b/src/Illuminate/Foundation/Console/ServeCommand.php @@ -201,6 +201,13 @@ protected function port() */ protected function getHostAndPort() { + if (preg_match('/(\[.*\]):?([0-9]+)?/', $this->input->getOption('host'), $matches) !== false) { + return [ + $matches[1] ?? $this->input->getOption('host'), + $matches[2] ?? null, + ]; + } + $hostParts = explode(':', $this->input->getOption('host')); return [