diff --git a/src/Illuminate/Foundation/Console/ProviderMakeCommand.php b/src/Illuminate/Foundation/Console/ProviderMakeCommand.php index fa887edb6251..ffe6499811d9 100644 --- a/src/Illuminate/Foundation/Console/ProviderMakeCommand.php +++ b/src/Illuminate/Foundation/Console/ProviderMakeCommand.php @@ -34,7 +34,20 @@ class ProviderMakeCommand extends GeneratorCommand */ protected function getStub() { - return __DIR__.'/stubs/provider.stub'; + return $this->resolveStubPath('/stubs/provider.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; } /** diff --git a/src/Illuminate/Foundation/Console/StubPublishCommand.php b/src/Illuminate/Foundation/Console/StubPublishCommand.php index 885f0f5c15dc..804eb15fc307 100644 --- a/src/Illuminate/Foundation/Console/StubPublishCommand.php +++ b/src/Illuminate/Foundation/Console/StubPublishCommand.php @@ -45,6 +45,7 @@ public function handle() __DIR__.'/stubs/notification.stub' => $stubsPath.'/notification.stub', __DIR__.'/stubs/observer.plain.stub' => $stubsPath.'/observer.plain.stub', __DIR__.'/stubs/observer.stub' => $stubsPath.'/observer.stub', + __DIR__.'/stubs/provider.stub' => $stubsPath.'/provider.stub', __DIR__.'/stubs/request.stub' => $stubsPath.'/request.stub', __DIR__.'/stubs/resource-collection.stub' => $stubsPath.'/resource-collection.stub', __DIR__.'/stubs/resource.stub' => $stubsPath.'/resource.stub', diff --git a/src/Illuminate/Foundation/Console/stubs/provider.stub b/src/Illuminate/Foundation/Console/stubs/provider.stub index fcd5d1241604..6dedc5842ad4 100644 --- a/src/Illuminate/Foundation/Console/stubs/provider.stub +++ b/src/Illuminate/Foundation/Console/stubs/provider.stub @@ -1,10 +1,10 @@