1 | <?php |
||
37 | class ArtisanServiceProvider extends BaseArtisanServiceProvider |
||
38 | { |
||
39 | /** |
||
40 | * Indicates if loading of the provider is deferred. |
||
41 | * |
||
42 | * @var bool |
||
43 | */ |
||
44 | protected $defer = true; |
||
45 | |||
46 | /** |
||
47 | * The commands to be registered. |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $commands = [ |
||
52 | 'CacheClear' => 'command.cache.clear', |
||
53 | 'CacheForget' => 'command.cache.forget', |
||
54 | 'ClearCompiled' => 'command.clear-compiled', |
||
55 | //'ClearResets' => 'command.auth.resets.clear', |
||
56 | 'ConfigCache' => 'command.config.cache', |
||
57 | 'ConfigClear' => 'command.config.clear', |
||
58 | 'Down' => 'command.down', |
||
59 | 'Environment' => 'command.environment', |
||
60 | 'KeyGenerate' => 'command.key.generate', |
||
61 | 'Migrate' => 'command.migrate', |
||
62 | 'MigrateFresh' => 'command.migrate.fresh', |
||
63 | 'MigrateInstall' => 'command.migrate.install', |
||
64 | 'MigrateRefresh' => 'command.migrate.refresh', |
||
65 | 'MigrateReset' => 'command.migrate.reset', |
||
66 | 'MigrateRollback' => 'command.migrate.rollback', |
||
67 | 'MigrateStatus' => 'command.migrate.status', |
||
68 | 'PackageDiscover' => 'command.package.discover', |
||
69 | 'Preset' => 'command.preset', |
||
70 | 'QueueFailed' => 'command.queue.failed', |
||
71 | 'QueueFlush' => 'command.queue.flush', |
||
72 | 'QueueForget' => 'command.queue.forget', |
||
73 | 'QueueListen' => 'command.queue.listen', |
||
74 | 'QueueRestart' => 'command.queue.restart', |
||
75 | 'QueueRetry' => 'command.queue.retry', |
||
76 | 'QueueWork' => 'command.queue.work', |
||
77 | 'RouteCache' => 'command.route.cache', |
||
78 | 'RouteClear' => 'command.route.clear', |
||
79 | 'RouteList' => 'command.route.list', |
||
80 | 'Seed' => 'command.seed', |
||
81 | 'ScheduleFinish' => ScheduleFinishCommand::class, |
||
82 | 'ScheduleRun' => ScheduleRunCommand::class, |
||
83 | 'StorageLink' => 'command.storage.link', |
||
84 | 'Up' => 'command.up', |
||
85 | 'ViewClear' => 'command.view.clear', |
||
86 | ]; |
||
87 | |||
88 | /** |
||
89 | * The commands to be registered. |
||
90 | * |
||
91 | * @var array |
||
92 | */ |
||
93 | protected $devCommands = [ |
||
94 | //'AppName' => 'command.app.name', |
||
95 | //'AuthMake' => 'command.auth.make', |
||
96 | //'CacheTable' => 'command.cache.table', |
||
97 | 'ConfigMake' => 'command.config.make', |
||
98 | 'ChannelMake' => 'command.channel.make', |
||
99 | 'ConsoleMake' => 'command.console.make', |
||
100 | 'ControllerMake' => 'command.controller.make', |
||
101 | 'DatatableMake' => 'command.datatable.make', |
||
102 | 'EventGenerate' => 'command.event.generate', |
||
103 | 'EventMake' => 'command.event.make', |
||
104 | 'ExceptionMake' => 'command.exception.make', |
||
105 | 'FactoryMake' => 'command.factory.make', |
||
106 | 'JobMake' => 'command.job.make', |
||
107 | 'ListenerMake' => 'command.listener.make', |
||
108 | 'MailMake' => 'command.mail.make', |
||
109 | 'MiddlewareMake' => 'command.middleware.make', |
||
110 | 'MigrateMake' => 'command.migrate.make', |
||
111 | 'ModelMake' => 'command.model.make', |
||
112 | 'ModuleMake' => 'command.module.make', |
||
113 | 'NotificationMake' => 'command.notification.make', |
||
114 | //'NotificationTable' => 'command.notification.table', |
||
115 | 'PolicyMake' => 'command.policy.make', |
||
116 | 'ProviderMake' => 'command.provider.make', |
||
117 | //'QueueFailedTable' => 'command.queue.failed-table', |
||
118 | //'QueueTable' => 'command.queue.table', |
||
119 | 'RequestMake' => 'command.request.make', |
||
120 | 'ResourceMake' => 'command.resource.make', |
||
121 | 'RuleMake' => 'command.rule.make', |
||
122 | 'SeederMake' => 'command.seeder.make', |
||
123 | //'SessionTable' => 'command.session.table', |
||
124 | 'Serve' => 'command.serve', |
||
125 | 'TestMake' => 'command.test.make', |
||
126 | 'TransformerMake' => 'command.transformer.make', |
||
127 | 'VendorPublish' => 'command.vendor.publish', |
||
128 | ]; |
||
129 | |||
130 | /** |
||
131 | * Register the service provider. |
||
132 | * |
||
133 | * @return void |
||
134 | */ |
||
135 | public function register(): void |
||
136 | { |
||
137 | ! $this->app->runningInConsole() || $this->registerCommands($this->commands); |
||
138 | ! $this->app->runningInConsole() || $this->registerCommands($this->devCommands); |
||
139 | } |
||
140 | |||
141 | /** |
||
142 | * Register the command. |
||
143 | * |
||
144 | * @return void |
||
145 | */ |
||
146 | protected function registerConfigMakeCommand(): void |
||
152 | |||
153 | /** |
||
154 | * Register the command. |
||
155 | * |
||
156 | * @return void |
||
157 | */ |
||
158 | protected function registerChannelMakeCommand() |
||
159 | { |
||
160 | $this->app->singleton('command.channel.make', function ($app) { |
||
161 | return new ChannelMakeCommand($app['files']); |
||
162 | }); |
||
163 | } |
||
164 | |||
165 | /** |
||
166 | * Register the command. |
||
167 | * |
||
168 | * @return void |
||
169 | */ |
||
170 | protected function registerConsoleMakeCommand(): void |
||
176 | |||
177 | /** |
||
178 | * Register the command. |
||
179 | * |
||
180 | * @return void |
||
181 | */ |
||
182 | protected function registerEventGenerateCommand() |
||
183 | { |
||
184 | $this->app->singleton('command.event.generate', function () { |
||
185 | return new EventGenerateCommand(); |
||
186 | }); |
||
187 | } |
||
188 | |||
189 | /** |
||
190 | * Register the command. |
||
191 | * |
||
192 | * @return void |
||
193 | */ |
||
194 | protected function registerControllerMakeCommand(): void |
||
200 | |||
201 | /** |
||
202 | * Register the command. |
||
203 | * |
||
204 | * @return void |
||
205 | */ |
||
206 | protected function registerDatatableMakeCommand(): void |
||
212 | |||
213 | /** |
||
214 | * Register the command. |
||
215 | * |
||
216 | * @return void |
||
217 | */ |
||
218 | protected function registerEventMakeCommand(): void |
||
224 | |||
225 | /** |
||
226 | * Register the command. |
||
227 | * |
||
228 | * @return void |
||
229 | */ |
||
230 | protected function registerExceptionMakeCommand() |
||
231 | { |
||
232 | $this->app->singleton('command.exception.make', function ($app) { |
||
233 | return new ExceptionMakeCommand($app['files']); |
||
234 | }); |
||
235 | } |
||
236 | |||
237 | /** |
||
238 | * Register the command. |
||
239 | * |
||
240 | * @return void |
||
241 | */ |
||
242 | protected function registerFactoryMakeCommand(): void |
||
248 | |||
249 | /** |
||
250 | * Register the command. |
||
251 | * |
||
252 | * @return void |
||
253 | */ |
||
254 | protected function registerJobMakeCommand(): void |
||
260 | |||
261 | /** |
||
262 | * Register the command. |
||
263 | * |
||
264 | * @return void |
||
265 | */ |
||
266 | protected function registerListenerMakeCommand(): void |
||
272 | |||
273 | /** |
||
274 | * Register the command. |
||
275 | * |
||
276 | * @return void |
||
277 | */ |
||
278 | protected function registerMailMakeCommand(): void |
||
284 | |||
285 | /** |
||
286 | * Register the command. |
||
287 | * |
||
288 | * @return void |
||
289 | */ |
||
290 | protected function registerMiddlewareMakeCommand(): void |
||
296 | |||
297 | /** |
||
298 | * Register the command. |
||
299 | * |
||
300 | * @return void |
||
301 | */ |
||
302 | protected function registerMigrateMakeCommand(): void |
||
315 | |||
316 | /** |
||
317 | * Register the command. |
||
318 | * |
||
319 | * @return void |
||
320 | */ |
||
321 | protected function registerModelMakeCommand(): void |
||
327 | |||
328 | /** |
||
329 | * Register the command. |
||
330 | * |
||
331 | * @return void |
||
332 | */ |
||
333 | protected function registerModuleMakeCommand(): void |
||
339 | |||
340 | /** |
||
341 | * Register the command. |
||
342 | * |
||
343 | * @return void |
||
344 | */ |
||
345 | protected function registerNotificationMakeCommand(): void |
||
351 | |||
352 | /** |
||
353 | * Register the command. |
||
354 | * |
||
355 | * @return void |
||
356 | */ |
||
357 | protected function registerPolicyMakeCommand(): void |
||
363 | |||
364 | /** |
||
365 | * Register the command. |
||
366 | * |
||
367 | * @return void |
||
368 | */ |
||
369 | protected function registerProviderMakeCommand(): void |
||
375 | |||
376 | /** |
||
377 | * Register the command. |
||
378 | * |
||
379 | * @return void |
||
380 | */ |
||
381 | protected function registerRequestMakeCommand(): void |
||
387 | |||
388 | /** |
||
389 | * Register the command. |
||
390 | * |
||
391 | * @return void |
||
392 | */ |
||
393 | protected function registerResourceMakeCommand(): void |
||
399 | |||
400 | /** |
||
401 | * Register the command. |
||
402 | * |
||
403 | * @return void |
||
404 | */ |
||
405 | protected function registerRuleMakeCommand(): void |
||
411 | |||
412 | /** |
||
413 | * Register the command. |
||
414 | * |
||
415 | * @return void |
||
416 | */ |
||
417 | protected function registerSeederMakeCommand(): void |
||
423 | |||
424 | /** |
||
425 | * Register the command. |
||
426 | * |
||
427 | * @return void |
||
428 | */ |
||
429 | protected function registerTransformerMakeCommand(): void |
||
435 | |||
436 | /** |
||
437 | * Register the command. |
||
438 | * |
||
439 | * @return void |
||
440 | */ |
||
441 | protected function registerServeCommand() |
||
447 | |||
448 | /** |
||
449 | * Register the command. |
||
450 | * |
||
451 | * @return void |
||
452 | */ |
||
453 | protected function registerVendorPublishCommand() |
||
459 | } |
||
460 |