Skip to content

Commit

Permalink
Update syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperTey committed Nov 23, 2024
1 parent 1e68e1d commit ae70e5d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Commands/DomainControllerMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ae70e5d

Please sign in to comment.