File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
src/Illuminate/Foundation/Console Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,20 @@ class ProviderMakeCommand extends GeneratorCommand
3434 */
3535 protected function getStub ()
3636 {
37- return __DIR__ .'/stubs/provider.stub ' ;
37+ return $ this ->resolveStubPath ('/stubs/provider.stub ' );
38+ }
39+
40+ /**
41+ * Resolve the fully-qualified path to the stub.
42+ *
43+ * @param string $stub
44+ * @return string
45+ */
46+ protected function resolveStubPath ($ stub )
47+ {
48+ return file_exists ($ customPath = $ this ->laravel ->basePath (trim ($ stub , '/ ' )))
49+ ? $ customPath
50+ : __DIR__ .$ stub ;
3851 }
3952
4053 /**
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ public function handle()
4545 __DIR__ .'/stubs/notification.stub ' => $ stubsPath .'/notification.stub ' ,
4646 __DIR__ .'/stubs/observer.plain.stub ' => $ stubsPath .'/observer.plain.stub ' ,
4747 __DIR__ .'/stubs/observer.stub ' => $ stubsPath .'/observer.stub ' ,
48+ __DIR__ .'/stubs/provider.stub ' => $ stubsPath .'/provider.stub ' ,
4849 __DIR__ .'/stubs/request.stub ' => $ stubsPath .'/request.stub ' ,
4950 __DIR__ .'/stubs/resource-collection.stub ' => $ stubsPath .'/resource-collection.stub ' ,
5051 __DIR__ .'/stubs/resource.stub ' => $ stubsPath .'/resource.stub ' ,
Original file line number Diff line number Diff line change 11<?php
22
3- namespace DummyNamespace ;
3+ namespace {{ namespace }} ;
44
55use Illuminate\Support\ServiceProvider;
66
7- class DummyClass extends ServiceProvider
7+ class {{ class }} extends ServiceProvider
88{
99 /**
1010 * Register services.
You can’t perform that action at this time.
0 commit comments