From 5af95eca8ee2d18077347a34b74a2658c8356682 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 8 Feb 2022 17:33:27 -0600 Subject: [PATCH] fix url replacement --- src/Console/InstallsApiStack.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Console/InstallsApiStack.php b/src/Console/InstallsApiStack.php index 2ea8dd7f4..a71d8610c 100644 --- a/src/Console/InstallsApiStack.php +++ b/src/Console/InstallsApiStack.php @@ -56,10 +56,9 @@ protected function installApiStack() copy(base_path('.env.example'), base_path('.env')); } - $this->replaceInFile( - 'APP_URL=http://localhost', - 'APP_URL=http://localhost'.PHP_EOL.'FRONTEND_URL=http://localhost:3000', - base_path('.env') + file_put_contents( + base_path('.env'), + preg_replace('/APP_URL=(.*)/', 'APP_URL=http://localhost:8000'.PHP_EOL.'FRONTEND_URL=http://localhost:3000', file_get_contents(base_path('.env'))) ); // Tests...