@@ -260,7 +260,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
260
260
if ($ name !== '. ' ) {
261
261
$ this ->replaceInFile (
262
262
'APP_URL=http://localhost ' ,
263
- 'APP_URL= ' .$ this ->generateAppUrl ($ name ),
263
+ 'APP_URL= ' .$ this ->generateAppUrl ($ name, $ directory ),
264
264
$ directory .'/.env '
265
265
);
266
266
@@ -323,7 +323,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
323
323
}
324
324
325
325
if ($ this ->isParkedOnHerdOrValet ($ directory )) {
326
- $ url = $ this ->generateAppUrl ($ name );
326
+ $ url = $ this ->generateAppUrl ($ name, $ directory );
327
327
$ output ->writeln ('<fg=gray>➜</> Open: <options=bold;href= ' .$ url .'> ' .$ url .'</> ' );
328
328
} else {
329
329
$ output ->writeln ('<fg=gray>➜</> <options=bold>composer run dev</> ' );
@@ -740,10 +740,15 @@ protected function verifyApplicationDoesntExist($directory)
740
740
* Generate a valid APP_URL for the given application name.
741
741
*
742
742
* @param string $name
743
+ * @param string $directory
743
744
* @return string
744
745
*/
745
- protected function generateAppUrl ($ name )
746
+ protected function generateAppUrl ($ name, $ directory )
746
747
{
748
+ if (! $ this ->isParkedOnHerdOrValet ($ directory )) {
749
+ return 'http://localhost:8000 ' ;
750
+ }
751
+
747
752
$ hostname = mb_strtolower ($ name ).'. ' .$ this ->getTld ();
748
753
749
754
return $ this ->canResolveHostname ($ hostname ) ? 'http:// ' .$ hostname : 'http://localhost ' ;
0 commit comments