Skip to content

Commit

Permalink
[11.x] Fixed trait stub paths after publish (#50678)
Browse files Browse the repository at this point in the history
  • Loading branch information
haroon-mahmood-4276 authored Mar 20, 2024
1 parent 2e3581d commit b8540dd
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Illuminate/Foundation/Console/TraitMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,20 @@ class TraitMakeCommand extends GeneratorCommand
*/
protected function getStub()
{
return __DIR__.'/stubs/trait.stub';
return $this->resolveStubPath('/stubs/trait.stub');
}

/**
* Resolve the fully-qualified path to the stub.
*
* @param string $stub
* @return string
*/
protected function resolveStubPath($stub)
{
return file_exists($customPath = $this->laravel->basePath(trim($stub, '/')))
? $customPath
: __DIR__.$stub;
}

/**
Expand Down

0 comments on commit b8540dd

Please sign in to comment.