diff --git a/src/Commands/DomainControllerMakeCommand.php b/src/Commands/DomainControllerMakeCommand.php index 2e50e0f..729d7c4 100644 --- a/src/Commands/DomainControllerMakeCommand.php +++ b/src/Commands/DomainControllerMakeCommand.php @@ -76,6 +76,9 @@ protected function buildClass($name) $replace["class {$controllerClass}".PHP_EOL] = "class {$controllerClass} extends Controller".PHP_EOL; } + // Remove Laravel 10 side effect + $replace["use {$this->getNamespace($name)}\Http\Controllers\Controller;".PHP_EOL] = ''; + $stub = str_replace( array_keys($replace), array_values($replace), diff --git a/tests/Generator/ControllerMakeTest.php b/tests/Generator/ControllerMakeTest.php index 1fb74cf..86f41e8 100644 --- a/tests/Generator/ControllerMakeTest.php +++ b/tests/Generator/ControllerMakeTest.php @@ -208,7 +208,7 @@ expect(file_exists($expectedPath))->toBeFalse(); // Remove the base controller - $baseControllerPath = base_path('app/Http/Controllers/Controller.php'); + $baseControllerPath = app_path('Http/Controllers/Controller.php'); if (file_exists($baseControllerPath)) { unlink($baseControllerPath);