Skip to content

Commit

Permalink
Revert "[11.x] Simplify .php extension chopping in getNameInput (l…
Browse files Browse the repository at this point in the history
…aravel#51843)"

This reverts commit 9b9e862.
  • Loading branch information
jasonmccreary committed Jun 26, 2024
1 parent 1076c91 commit 7c55765
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Illuminate/Console/GeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,13 @@ protected function sortImports($stub)
*/
protected function getNameInput()
{
return (string) Str::of($this->argument('name'))->trim()->beforeLast('.php');
$name = trim($this->argument('name'));

if (Str::endsWith($name, '.php')) {
return Str::substr($name, 0, -4);
}

return $name;
}

/**
Expand Down

0 comments on commit 7c55765

Please sign in to comment.