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\ScaffoldGeneratorCommand; |
28
|
|
|
use PWWEB\Artomator\Commands\Scaffold\ViewsGeneratorCommand; |
29
|
|
|
|
30
|
|
|
class ArtomatorServiceProvider extends ServiceProvider |
31
|
|
|
{ |
32
|
|
|
/** |
33
|
|
|
* Bootstrap the application services. |
34
|
|
|
* |
35
|
|
|
* @return void |
36
|
|
|
*/ |
37
|
|
|
public function boot() |
38
|
|
|
{ |
39
|
|
|
$configPath = __DIR__.'/../config/artomator.php'; |
40
|
|
|
$configPathInfyom = __DIR__.'/../../../infyomlabs/laravel-generator/config/laravel_generator.php'; |
41
|
|
|
$schemaPath = __DIR__.'/../../../nuwave/lighthouse/assets/default-schema.graphql'; |
42
|
|
|
$configPathNuwave = __DIR__.'/../../../nuwave/lighthouse/src/lighthouse.php'; |
43
|
|
|
|
44
|
|
|
$this->publishes( |
45
|
|
|
[ |
46
|
|
|
$configPath => config_path('pwweb/artomator.php'), |
47
|
|
|
$configPathInfyom => config_path('infyom/laravel_generator.php'), |
48
|
|
|
$configPathNuwave => config_path('lighthouse.php'), |
49
|
|
|
$schemaPath => config('lighthouse.schema.register', base_path('graphql/schema.graphql')), |
50
|
|
|
], |
51
|
|
|
'artomator' |
52
|
|
|
); |
53
|
|
|
|
54
|
|
|
parent::boot(); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Register the application services. |
59
|
|
|
*/ |
60
|
|
|
public function register() |
61
|
|
|
{ |
62
|
|
|
$this->app->singleton('artomator.publish', function ($app) { |
|
|
|
|
63
|
|
|
return new GeneratorPublishCommand(); |
64
|
|
|
}); |
65
|
|
|
|
66
|
|
|
$this->app->singleton('artomator.api', function ($app) { |
|
|
|
|
67
|
|
|
return new APIGeneratorCommand(); |
68
|
|
|
}); |
69
|
|
|
|
70
|
|
|
$this->app->singleton('artomator.scaffold', function ($app) { |
|
|
|
|
71
|
|
|
return new ScaffoldGeneratorCommand(); |
72
|
|
|
}); |
73
|
|
|
|
74
|
|
|
$this->app->singleton('artomator.publish.layout', function ($app) { |
|
|
|
|
75
|
|
|
return new LayoutPublishCommand(); |
76
|
|
|
}); |
77
|
|
|
|
78
|
|
|
$this->app->singleton('artomator.publish.templates', function ($app) { |
|
|
|
|
79
|
|
|
return new PublishTemplateCommand(); |
80
|
|
|
}); |
81
|
|
|
|
82
|
|
|
$this->app->singleton('artomator.api_scaffold', function ($app) { |
|
|
|
|
83
|
|
|
return new APIScaffoldGeneratorCommand(); |
84
|
|
|
}); |
85
|
|
|
|
86
|
|
|
$this->app->singleton('artomator.migration', function ($app) { |
|
|
|
|
87
|
|
|
return new MigrationGeneratorCommand(); |
88
|
|
|
}); |
89
|
|
|
|
90
|
|
|
$this->app->singleton('artomator.model', function ($app) { |
|
|
|
|
91
|
|
|
return new ModelGeneratorCommand(); |
92
|
|
|
}); |
93
|
|
|
|
94
|
|
|
$this->app->singleton('artomator.repository', function ($app) { |
|
|
|
|
95
|
|
|
return new RepositoryGeneratorCommand(); |
96
|
|
|
}); |
97
|
|
|
|
98
|
|
|
$this->app->singleton('artomator.api.controller', function ($app) { |
|
|
|
|
99
|
|
|
return new APIControllerGeneratorCommand(); |
100
|
|
|
}); |
101
|
|
|
|
102
|
|
|
$this->app->singleton('artomator.api.requests', function ($app) { |
|
|
|
|
103
|
|
|
return new APIRequestsGeneratorCommand(); |
104
|
|
|
}); |
105
|
|
|
|
106
|
|
|
$this->app->singleton('artomator.api.tests', function ($app) { |
|
|
|
|
107
|
|
|
return new TestsGeneratorCommand(); |
108
|
|
|
}); |
109
|
|
|
|
110
|
|
|
$this->app->singleton('artomator.scaffold.controller', function ($app) { |
|
|
|
|
111
|
|
|
return new ControllerGeneratorCommand(); |
112
|
|
|
}); |
113
|
|
|
|
114
|
|
|
$this->app->singleton('artomator.scaffold.requests', function ($app) { |
|
|
|
|
115
|
|
|
return new RequestsGeneratorCommand(); |
116
|
|
|
}); |
117
|
|
|
|
118
|
|
|
$this->app->singleton('artomator.scaffold.views', function ($app) { |
|
|
|
|
119
|
|
|
return new ViewsGeneratorCommand(); |
120
|
|
|
}); |
121
|
|
|
|
122
|
|
|
$this->app->singleton('artomator.rollback', function ($app) { |
|
|
|
|
123
|
|
|
return new RollbackGeneratorCommand(); |
124
|
|
|
}); |
125
|
|
|
|
126
|
|
|
$this->app->singleton('artomator.publish.user', function ($app) { |
|
|
|
|
127
|
|
|
return new PublishUserCommand(); |
128
|
|
|
}); |
129
|
|
|
|
130
|
|
|
$this->app->singleton('artomator.graphql', function ($app) { |
|
|
|
|
131
|
|
|
return new GraphQLGeneratorCommand(); |
132
|
|
|
}); |
133
|
|
|
|
134
|
|
|
$this->app->singleton('artomator.graphql_scaffold', function ($app) { |
|
|
|
|
135
|
|
|
return new GraphQLScaffoldGeneratorCommand(); |
136
|
|
|
}); |
137
|
|
|
|
138
|
|
|
$this->app->singleton('artomator.graphql.query', function ($app) { |
|
|
|
|
139
|
|
|
return new GraphQLQueryGeneratorCommand(); |
140
|
|
|
}); |
141
|
|
|
|
142
|
|
|
$this->app->singleton('artomator.graphql.mutations', function ($app) { |
|
|
|
|
143
|
|
|
return new GraphQLMutationsGeneratorCommand(); |
144
|
|
|
}); |
145
|
|
|
|
146
|
|
|
$this->app->singleton('artomator.graphql.type', function ($app) { |
|
|
|
|
147
|
|
|
return new GraphQLTypeGeneratorCommand(); |
148
|
|
|
}); |
149
|
|
|
|
150
|
|
|
$this->app->singleton('artomator.graphql.subscription', function ($app) { |
|
|
|
|
151
|
|
|
return new GraphQLSubscriptionGeneratorCommand(); |
152
|
|
|
}); |
153
|
|
|
|
154
|
|
|
parent::register(); |
155
|
|
|
|
156
|
|
|
$this->commands( |
157
|
|
|
[ |
158
|
|
|
'artomator.publish', |
159
|
|
|
'artomator.api', |
160
|
|
|
'artomator.scaffold', |
161
|
|
|
'artomator.api_scaffold', |
162
|
|
|
'artomator.publish.layout', |
163
|
|
|
'artomator.publish.templates', |
164
|
|
|
'artomator.migration', |
165
|
|
|
'artomator.model', |
166
|
|
|
'artomator.repository', |
167
|
|
|
'artomator.api.controller', |
168
|
|
|
'artomator.api.requests', |
169
|
|
|
'artomator.api.tests', |
170
|
|
|
'artomator.scaffold.controller', |
171
|
|
|
'artomator.scaffold.requests', |
172
|
|
|
'artomator.scaffold.views', |
173
|
|
|
'artomator.rollback', |
174
|
|
|
'artomator.publish.user', |
175
|
|
|
'artomator.graphql', |
176
|
|
|
'artomator.graphql_scaffold', |
177
|
|
|
'artomator.graphql.query', |
178
|
|
|
'artomator.graphql.mutations', |
179
|
|
|
'artomator.graphql.type', |
180
|
|
|
'artomator.graphql.subscription', |
181
|
|
|
] |
182
|
|
|
); |
183
|
|
|
} |
184
|
|
|
} |
185
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.