File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
src/Illuminate/Foundation/Console Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,22 @@ class ClassMakeCommand extends GeneratorCommand
37
37
*/
38
38
protected function getStub ()
39
39
{
40
- if ($ this ->option ('invokable ' )) {
41
- return __DIR__ .'/stubs/class.invokable.stub ' ;
42
- }
40
+ return $ this ->option ('invokable ' )
41
+ ? $ this ->resolveStubPath ('/stubs/class.invokable.stub ' )
42
+ : $ this ->resolveStubPath ('/stubs/class.stub ' );
43
+ }
43
44
44
- return __DIR__ .'/stubs/class.stub ' ;
45
+ /**
46
+ * Resolve the fully-qualified path to the stub.
47
+ *
48
+ * @param string $stub
49
+ * @return string
50
+ */
51
+ protected function resolveStubPath ($ stub )
52
+ {
53
+ return file_exists ($ customPath = $ this ->laravel ->basePath (trim ($ stub , '/ ' )))
54
+ ? $ customPath
55
+ : __DIR__ .$ stub ;
45
56
}
46
57
47
58
/**
You can’t perform that action at this time.
0 commit comments