diff --git a/src/Commands/DomainControllerMakeCommand.php b/src/Commands/DomainControllerMakeCommand.php index 3e872b3..80f4797 100644 --- a/src/Commands/DomainControllerMakeCommand.php +++ b/src/Commands/DomainControllerMakeCommand.php @@ -62,11 +62,10 @@ protected function buildClass($name) } // Handle Laravel 10 side effect - $invalidUse = "use {$this->getNamespace($name)}\Http\Controllers\Controller;"; - if (strpos($stub, $invalidUse) !== false) { + if (str($stub)->contains($invalidUse = "use {$this->getNamespace($name)}\Http\Controllers\Controller;\n")) { $laravel10Replacements = [ - $invalidUse.PHP_EOL => '', ' extends Controller' => '', + $invalidUse => '', ]; $stub = str_replace(