@@ -31,65 +31,65 @@ public function boot()
31
31
} elseif ($ this ->app instanceof LumenApplication) {
32
32
$ this ->app ->configure ('repository ' );
33
33
}
34
-
35
- $ this ->registerCommand ();
36
34
}
37
35
38
36
/**
39
37
* Register the service provider.
40
38
*/
41
39
public function register (): void
42
40
{
43
-
41
+ $ this -> registerCommands ();
44
42
}
45
43
46
44
/**
47
45
* Register custom commands.
48
46
*/
49
- private function registerCommand (): void
47
+ private function registerCommands (): void
50
48
{
51
- $ this ->app ->singleton ('command.make-all-repository ' , function () {
52
- return new MakeAllRepository ();
53
- });
54
-
55
- $ this ->app ->singleton ('command.make-entity ' , function () {
56
- return new MakeEntity ();
57
- });
58
-
59
- $ this ->app ->singleton ('command.make-factory ' , function () {
60
- return new MakeFactory ();
61
- });
62
-
63
- $ this ->app ->singleton ('command.make-interface-repository ' , function () {
64
- return new MakeInterfaceRepository ();
65
- });
66
-
67
- $ this ->app ->singleton ('command.make-mysql-repository ' , function () {
68
- return new MakeMySqlRepository ();
69
- });
70
-
71
- $ this ->app ->singleton ('command.make-redis-repository ' , function () {
72
- return new MakeRedisRepository ();
73
- });
74
-
75
- $ this ->app ->singleton ('command.make-repository ' , function () {
76
- return new MakeRepository ();
77
- });
78
-
79
- $ this ->app ->singleton ('command.make-resource ' , function () {
80
- return new MakeResource ();
81
- });
82
-
83
- $ this ->commands ([
84
- MakeAllRepository::class,
85
- MakeEntity::class,
86
- MakeFactory::class,
87
- MakeInterfaceRepository::class,
88
- MakeMySqlRepository::class,
89
- MakeRedisRepository::class,
90
- MakeRepository::class,
91
- MakeResource::class
92
- ]);
49
+ if ($ this ->app ->runningInConsole ()) {
50
+ $ this ->app ->singleton ('command.make-all-repository ' , function () {
51
+ return new MakeAllRepository ();
52
+ });
53
+
54
+ $ this ->app ->singleton ('command.make-entity ' , function () {
55
+ return new MakeEntity ();
56
+ });
57
+
58
+ $ this ->app ->singleton ('command.make-factory ' , function () {
59
+ return new MakeFactory ();
60
+ });
61
+
62
+ $ this ->app ->singleton ('command.make-interface-repository ' , function () {
63
+ return new MakeInterfaceRepository ();
64
+ });
65
+
66
+ $ this ->app ->singleton ('command.make-mysql-repository ' , function () {
67
+ return new MakeMySqlRepository ();
68
+ });
69
+
70
+ $ this ->app ->singleton ('command.make-redis-repository ' , function () {
71
+ return new MakeRedisRepository ();
72
+ });
73
+
74
+ $ this ->app ->singleton ('command.make-repository ' , function () {
75
+ return new MakeRepository ();
76
+ });
77
+
78
+ $ this ->app ->singleton ('command.make-resource ' , function () {
79
+ return new MakeResource ();
80
+ });
81
+
82
+ $ this ->commands ([
83
+ MakeAllRepository::class,
84
+ MakeEntity::class,
85
+ MakeFactory::class,
86
+ MakeInterfaceRepository::class,
87
+ MakeMySqlRepository::class,
88
+ MakeRedisRepository::class,
89
+ MakeRepository::class,
90
+ MakeResource::class
91
+ ]);
92
+ }
93
93
}
94
94
95
95
}
0 commit comments