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
34
34
*/
35
35
protected function getStub ()
36
36
{
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 ;
38
51
}
39
52
40
53
/**
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ public function handle()
45
45
__DIR__ .'/stubs/notification.stub ' => $ stubsPath .'/notification.stub ' ,
46
46
__DIR__ .'/stubs/observer.plain.stub ' => $ stubsPath .'/observer.plain.stub ' ,
47
47
__DIR__ .'/stubs/observer.stub ' => $ stubsPath .'/observer.stub ' ,
48
+ __DIR__ .'/stubs/provider.stub ' => $ stubsPath .'/provider.stub ' ,
48
49
__DIR__ .'/stubs/request.stub ' => $ stubsPath .'/request.stub ' ,
49
50
__DIR__ .'/stubs/resource-collection.stub ' => $ stubsPath .'/resource-collection.stub ' ,
50
51
__DIR__ .'/stubs/resource.stub ' => $ stubsPath .'/resource.stub ' ,
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace DummyNamespace ;
3
+ namespace {{ namespace }} ;
4
4
5
5
use Illuminate\Support\ServiceProvider;
6
6
7
- class DummyClass extends ServiceProvider
7
+ class {{ class }} extends ServiceProvider
8
8
{
9
9
/**
10
10
* Register services.
You can’t perform that action at this time.
0 commit comments