Skip to content

Commit b8540dd

Browse files
[11.x] Fixed trait stub paths after publish (#50678)
1 parent 2e3581d commit b8540dd

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/Illuminate/Foundation/Console/TraitMakeCommand.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,20 @@ class TraitMakeCommand extends GeneratorCommand
3737
*/
3838
protected function getStub()
3939
{
40-
return __DIR__.'/stubs/trait.stub';
40+
return $this->resolveStubPath('/stubs/trait.stub');
41+
}
42+
43+
/**
44+
* Resolve the fully-qualified path to the stub.
45+
*
46+
* @param string $stub
47+
* @return string
48+
*/
49+
protected function resolveStubPath($stub)
50+
{
51+
return file_exists($customPath = $this->laravel->basePath(trim($stub, '/')))
52+
? $customPath
53+
: __DIR__.$stub;
4154
}
4255

4356
/**

0 commit comments

Comments
 (0)