1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PWWEB\Artomator; |
4
|
|
|
|
5
|
|
|
use InfyOm\Generator\InfyOmGeneratorServiceProvider as ServiceProvider; |
6
|
|
|
use PWWEB\Artomator\Commands\API\APIControllerGeneratorCommand; |
7
|
|
|
use PWWEB\Artomator\Commands\API\APIGeneratorCommand; |
8
|
|
|
use PWWEB\Artomator\Commands\API\APIRequestsGeneratorCommand; |
9
|
|
|
use PWWEB\Artomator\Commands\API\TestsGeneratorCommand; |
10
|
|
|
use PWWEB\Artomator\Commands\APIScaffoldGeneratorCommand; |
11
|
|
|
use PWWEB\Artomator\Commands\Common\MigrationGeneratorCommand; |
12
|
|
|
use PWWEB\Artomator\Commands\Common\ModelGeneratorCommand; |
13
|
|
|
use PWWEB\Artomator\Commands\Common\RepositoryGeneratorCommand; |
14
|
|
|
use PWWEB\Artomator\Commands\GraphQL\GraphQLGeneratorCommand; |
15
|
|
|
use PWWEB\Artomator\Commands\GraphQL\GraphQLMutationsGeneratorCommand; |
16
|
|
|
use PWWEB\Artomator\Commands\GraphQL\GraphQLQueryGeneratorCommand; |
17
|
|
|
use PWWEB\Artomator\Commands\GraphQL\GraphQLSubscriptionGeneratorCommand; |
18
|
|
|
use PWWEB\Artomator\Commands\GraphQL\GraphQLTypeGeneratorCommand; |
19
|
|
|
use PWWEB\Artomator\Commands\GraphQLScaffoldGeneratorCommand; |
20
|
|
|
use PWWEB\Artomator\Commands\Publish\GeneratorPublishCommand; |
21
|
|
|
use PWWEB\Artomator\Commands\Publish\LayoutPublishCommand; |
22
|
|
|
use PWWEB\Artomator\Commands\Publish\PublishTemplateCommand; |
23
|
|
|
use PWWEB\Artomator\Commands\Publish\PublishUserCommand; |
24
|
|
|
use PWWEB\Artomator\Commands\RollbackGeneratorCommand; |
25
|
|
|
use PWWEB\Artomator\Commands\Scaffold\ControllerGeneratorCommand; |
26
|
|
|
use PWWEB\Artomator\Commands\Scaffold\RequestsGeneratorCommand; |
27
|
|
|
use PWWEB\Artomator\Commands\Scaffold\RoutesGeneratorCommand; |
28
|
|
|
use PWWEB\Artomator\Commands\Scaffold\ScaffoldGeneratorCommand; |
29
|
|
|
use PWWEB\Artomator\Commands\Scaffold\ViewsGeneratorCommand; |
30
|
|
|
|
31
|
|
|
class ArtomatorServiceProvider extends ServiceProvider |
32
|
|
|
{ |
33
|
|
|
/** |
34
|
|
|
* Bootstrap the application services. |
35
|
|
|
* |
36
|
|
|
* @return void |
37
|
|
|
*/ |
38
|
|
|
public function boot() |
39
|
|
|
{ |
40
|
|
|
$configPath = __DIR__.'/../config/artomator.php'; |
41
|
|
|
$paginationResource = __DIR__.'/../resource/js/Shared/Pagination.vue'; |
42
|
|
|
|
43
|
|
|
$this->publishes( |
44
|
|
|
[ |
45
|
|
|
$configPath => config_path('pwweb/artomator.php'), |
46
|
|
|
$paginationResource => resource_path('js/Shared/Pagination.vue'), |
47
|
|
|
], |
48
|
|
|
'artomator' |
49
|
|
|
); |
50
|
|
|
|
51
|
|
|
parent::boot(); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Register the application services. |
56
|
|
|
* |
57
|
|
|
* @return void |
58
|
|
|
*/ |
59
|
|
|
public function register() |
60
|
|
|
{ |
61
|
|
|
$this->app->singleton( |
62
|
|
|
'artomator.publish', |
63
|
|
|
function ($app) { |
|
|
|
|
64
|
|
|
return new GeneratorPublishCommand(); |
65
|
|
|
} |
66
|
|
|
); |
67
|
|
|
|
68
|
|
|
$this->app->singleton( |
69
|
|
|
'artomator.api', |
70
|
|
|
function ($app) { |
|
|
|
|
71
|
|
|
return new APIGeneratorCommand(); |
72
|
|
|
} |
73
|
|
|
); |
74
|
|
|
|
75
|
|
|
$this->app->singleton( |
76
|
|
|
'artomator.scaffold', |
77
|
|
|
function ($app) { |
|
|
|
|
78
|
|
|
return new ScaffoldGeneratorCommand(); |
79
|
|
|
} |
80
|
|
|
); |
81
|
|
|
|
82
|
|
|
$this->app->singleton( |
83
|
|
|
'artomator.publish.layout', |
84
|
|
|
function ($app) { |
|
|
|
|
85
|
|
|
return new LayoutPublishCommand(); |
86
|
|
|
} |
87
|
|
|
); |
88
|
|
|
|
89
|
|
|
$this->app->singleton( |
90
|
|
|
'artomator.publish.templates', |
91
|
|
|
function ($app) { |
|
|
|
|
92
|
|
|
return new PublishTemplateCommand(); |
93
|
|
|
} |
94
|
|
|
); |
95
|
|
|
|
96
|
|
|
$this->app->singleton( |
97
|
|
|
'artomator.api_scaffold', |
98
|
|
|
function ($app) { |
|
|
|
|
99
|
|
|
return new APIScaffoldGeneratorCommand(); |
100
|
|
|
} |
101
|
|
|
); |
102
|
|
|
|
103
|
|
|
$this->app->singleton( |
104
|
|
|
'artomator.migration', |
105
|
|
|
function ($app) { |
|
|
|
|
106
|
|
|
return new MigrationGeneratorCommand(); |
107
|
|
|
} |
108
|
|
|
); |
109
|
|
|
|
110
|
|
|
$this->app->singleton( |
111
|
|
|
'artomator.model', |
112
|
|
|
function ($app) { |
|
|
|
|
113
|
|
|
return new ModelGeneratorCommand(); |
114
|
|
|
} |
115
|
|
|
); |
116
|
|
|
|
117
|
|
|
$this->app->singleton( |
118
|
|
|
'artomator.repository', |
119
|
|
|
function ($app) { |
|
|
|
|
120
|
|
|
return new RepositoryGeneratorCommand(); |
121
|
|
|
} |
122
|
|
|
); |
123
|
|
|
|
124
|
|
|
$this->app->singleton( |
125
|
|
|
'artomator.api.controller', |
126
|
|
|
function ($app) { |
|
|
|
|
127
|
|
|
return new APIControllerGeneratorCommand(); |
128
|
|
|
} |
129
|
|
|
); |
130
|
|
|
|
131
|
|
|
$this->app->singleton( |
132
|
|
|
'artomator.api.requests', |
133
|
|
|
function ($app) { |
|
|
|
|
134
|
|
|
return new APIRequestsGeneratorCommand(); |
135
|
|
|
} |
136
|
|
|
); |
137
|
|
|
|
138
|
|
|
$this->app->singleton( |
139
|
|
|
'artomator.api.tests', |
140
|
|
|
function ($app) { |
|
|
|
|
141
|
|
|
return new TestsGeneratorCommand(); |
142
|
|
|
} |
143
|
|
|
); |
144
|
|
|
|
145
|
|
|
$this->app->singleton( |
146
|
|
|
'artomator.scaffold.controller', |
147
|
|
|
function ($app) { |
|
|
|
|
148
|
|
|
return new ControllerGeneratorCommand(); |
149
|
|
|
} |
150
|
|
|
); |
151
|
|
|
|
152
|
|
|
$this->app->singleton( |
153
|
|
|
'artomator.scaffold.requests', |
154
|
|
|
function ($app) { |
|
|
|
|
155
|
|
|
return new RequestsGeneratorCommand(); |
156
|
|
|
} |
157
|
|
|
); |
158
|
|
|
|
159
|
|
|
$this->app->singleton( |
160
|
|
|
'artomator.scaffold.views', |
161
|
|
|
function ($app) { |
|
|
|
|
162
|
|
|
return new ViewsGeneratorCommand(); |
163
|
|
|
} |
164
|
|
|
); |
165
|
|
|
|
166
|
|
|
$this->app->singleton( |
167
|
|
|
'artomator.scaffold.routes', |
168
|
|
|
function ($app) { |
|
|
|
|
169
|
|
|
return new RoutesGeneratorCommand(); |
170
|
|
|
} |
171
|
|
|
); |
172
|
|
|
|
173
|
|
|
$this->app->singleton( |
174
|
|
|
'artomator.rollback', |
175
|
|
|
function ($app) { |
|
|
|
|
176
|
|
|
return new RollbackGeneratorCommand(); |
177
|
|
|
} |
178
|
|
|
); |
179
|
|
|
|
180
|
|
|
$this->app->singleton( |
181
|
|
|
'artomator.publish.user', |
182
|
|
|
function ($app) { |
|
|
|
|
183
|
|
|
return new PublishUserCommand(); |
184
|
|
|
} |
185
|
|
|
); |
186
|
|
|
|
187
|
|
|
$this->app->singleton( |
188
|
|
|
'artomator.graphql', |
189
|
|
|
function ($app) { |
|
|
|
|
190
|
|
|
return new GraphQLGeneratorCommand(); |
191
|
|
|
} |
192
|
|
|
); |
193
|
|
|
|
194
|
|
|
$this->app->singleton( |
195
|
|
|
'artomator.graphql_scaffold', |
196
|
|
|
function ($app) { |
|
|
|
|
197
|
|
|
return new GraphQLScaffoldGeneratorCommand(); |
198
|
|
|
} |
199
|
|
|
); |
200
|
|
|
|
201
|
|
|
$this->app->singleton( |
202
|
|
|
'artomator.graphql.query', |
203
|
|
|
function ($app) { |
|
|
|
|
204
|
|
|
return new GraphQLQueryGeneratorCommand(); |
205
|
|
|
} |
206
|
|
|
); |
207
|
|
|
|
208
|
|
|
$this->app->singleton( |
209
|
|
|
'artomator.graphql.mutations', |
210
|
|
|
function ($app) { |
|
|
|
|
211
|
|
|
return new GraphQLMutationsGeneratorCommand(); |
212
|
|
|
} |
213
|
|
|
); |
214
|
|
|
|
215
|
|
|
$this->app->singleton( |
216
|
|
|
'artomator.graphql.type', |
217
|
|
|
function ($app) { |
|
|
|
|
218
|
|
|
return new GraphQLTypeGeneratorCommand(); |
219
|
|
|
} |
220
|
|
|
); |
221
|
|
|
|
222
|
|
|
$this->app->singleton( |
223
|
|
|
'artomator.graphql.subscription', |
224
|
|
|
function ($app) { |
|
|
|
|
225
|
|
|
return new GraphQLSubscriptionGeneratorCommand(); |
226
|
|
|
} |
227
|
|
|
); |
228
|
|
|
|
229
|
|
|
parent::register(); |
230
|
|
|
|
231
|
|
|
$this->commands( |
232
|
|
|
[ |
233
|
|
|
'artomator.publish', |
234
|
|
|
'artomator.api', |
235
|
|
|
'artomator.scaffold', |
236
|
|
|
'artomator.api_scaffold', |
237
|
|
|
'artomator.publish.layout', |
238
|
|
|
'artomator.publish.templates', |
239
|
|
|
'artomator.migration', |
240
|
|
|
'artomator.model', |
241
|
|
|
'artomator.repository', |
242
|
|
|
'artomator.api.controller', |
243
|
|
|
'artomator.api.requests', |
244
|
|
|
'artomator.api.tests', |
245
|
|
|
'artomator.scaffold.controller', |
246
|
|
|
'artomator.scaffold.requests', |
247
|
|
|
'artomator.scaffold.views', |
248
|
|
|
'artomator.scaffold.routes', |
249
|
|
|
'artomator.rollback', |
250
|
|
|
'artomator.publish.user', |
251
|
|
|
'artomator.graphql', |
252
|
|
|
'artomator.graphql_scaffold', |
253
|
|
|
'artomator.graphql.query', |
254
|
|
|
'artomator.graphql.mutations', |
255
|
|
|
'artomator.graphql.type', |
256
|
|
|
'artomator.graphql.subscription', |
257
|
|
|
Console\InstallCommand::class, |
258
|
|
|
] |
259
|
|
|
); |
260
|
|
|
} |
261
|
|
|
} |
262
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.