From 95cfef29fcca9eed6c3f6594d3d2d84e31afc65f Mon Sep 17 00:00:00 2001 From: MuriloChianfa Date: Fri, 21 Jul 2023 21:59:10 -0300 Subject: [PATCH] Allowing bind of IPv6 addresses in development server --- src/Illuminate/Foundation/Console/ServeCommand.php | 7 +++++++ 1 file changed, 7 insertions(+) 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 [