From a6c184abe018a5bfaa9fe34fef818d947a54756c Mon Sep 17 00:00:00 2001 From: Jasper Tey Date: Fri, 22 Nov 2024 22:17:29 -0500 Subject: [PATCH] Try replacing PHP_EOLs --- src/Commands/DomainControllerMakeCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Commands/DomainControllerMakeCommand.php b/src/Commands/DomainControllerMakeCommand.php index e91e67f..4271a2d 100644 --- a/src/Commands/DomainControllerMakeCommand.php +++ b/src/Commands/DomainControllerMakeCommand.php @@ -79,7 +79,7 @@ protected function buildClass($name) $replace = []; $appRootNamespace = $this->laravel->getNamespace(); - $pathToAppBaseController = Path::normalize(app_path('Http/Controllers/Controller.php')); + $pathToAppBaseController = Path::normalize(app()->path('Http/Controllers/Controller.php')); $baseControllerExists = $this->files->exists($pathToAppBaseController); @@ -87,8 +87,8 @@ protected function buildClass($name) $controllerClass = class_basename($name); $fullyQualifiedBaseController = "{$appRootNamespace}Http\Controllers\Controller"; $namespaceLine = "namespace {$this->getNamespace($name)};"; - $replace[$namespaceLine.PHP_EOL] = $namespaceLine.PHP_EOL.PHP_EOL."use {$fullyQualifiedBaseController};"; - $replace["class {$controllerClass}".PHP_EOL] = "class {$controllerClass} extends Controller".PHP_EOL; + $replace["{$namespaceLine}\n"] = "{$namespaceLine}\n\nuse {$fullyQualifiedBaseController};"; + $replace["class {$controllerClass}\n"] = "class {$controllerClass} extends Controller\n"; } $stub = str_replace(