We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 50124be commit bafbec4Copy full SHA for bafbec4
src/Illuminate/Foundation/Console/EnumMakeCommand.php
@@ -42,10 +42,23 @@ class EnumMakeCommand extends GeneratorCommand
42
protected function getStub()
43
{
44
if ($this->option('string') || $this->option('int')) {
45
- return __DIR__.'/stubs/enum.backed.stub';
+ return $this->resolveStubPath('/stubs/enum.backed.stub');
46
}
47
48
- return __DIR__.'/stubs/enum.stub';
+ return $this->resolveStubPath('/stubs/enum.stub');
49
+ }
50
+
51
+ /**
52
+ * Resolve the fully-qualified path to the stub.
53
+ *
54
+ * @param string $stub
55
+ * @return string
56
+ */
57
+ protected function resolveStubPath($stub)
58
+ {
59
+ return file_exists($customPath = $this->laravel->basePath(trim($stub, '/')))
60
+ ? $customPath
61
+ : __DIR__.$stub;
62
63
64
/**
0 commit comments