@@ -28,23 +28,27 @@ class DatabaseRepositoryServiceProvider extends ServiceProvider
28
28
*/
29
29
public function boot ()
30
30
{
31
- $ this ->publishes ([
32
- __DIR__ . '/Config/ ' . self ::CONFIG_FILE => config_path (self ::CONFIG_FILE ),
33
- ], 'config ' );
31
+ if ($ this ->app ->runningInConsole ()) {
32
+ $ this ->publishes ([
33
+ __DIR__ . '/Config/ ' . self ::CONFIG_FILE => config_path (self ::CONFIG_FILE ),
34
+ ], 'config ' );
35
+
36
+ $ this ->register ();
37
+ }
34
38
}
35
39
36
40
/**
37
41
* Register the service provider.
38
42
*/
39
- public function register ()
43
+ public function register (): void
40
44
{
41
45
$ this ->registerCommand ();
42
46
}
43
47
44
48
/**
45
49
* Register custom commands.
46
50
*/
47
- private function registerCommand ()
51
+ private function registerCommand (): void
48
52
{
49
53
$ this ->app ->singleton ('command.make-all-repository ' , function () {
50
54
return new MakeAllRepository ();
@@ -79,14 +83,14 @@ private function registerCommand()
79
83
});
80
84
81
85
$ this ->commands ([
82
- ' command.make-all-repository ' ,
83
- ' command.make-entity ' ,
84
- ' command.make-factory ' ,
85
- ' command.make-interface-repository ' ,
86
- ' command.make-mysql-repository ' ,
87
- ' command.make-redis-repository ' ,
88
- ' command.make-repository ' ,
89
- ' command.make-resource '
86
+ MakeAllRepository::class ,
87
+ MakeEntity::class ,
88
+ MakeFactory::class ,
89
+ MakeInterfaceRepository::class ,
90
+ MakeMySqlRepository::class ,
91
+ MakeRedisRepository::class ,
92
+ MakeRepository::class ,
93
+ MakeResource::class
90
94
]);
91
95
}
92
96
0 commit comments