1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Nwidart\Modules\Providers; |
4
|
|
|
|
5
|
|
|
use Illuminate\Support\ServiceProvider; |
6
|
|
|
use Nwidart\Modules\Commands\CommandCommand; |
7
|
|
|
use Nwidart\Modules\Commands\ControllerCommand; |
8
|
|
|
use Nwidart\Modules\Commands\DisableCommand; |
9
|
|
|
use Nwidart\Modules\Commands\DumpCommand; |
10
|
|
|
use Nwidart\Modules\Commands\EnableCommand; |
11
|
|
|
use Nwidart\Modules\Commands\GenerateMiddlewareCommand; |
12
|
|
|
use Nwidart\Modules\Commands\GenerateProviderCommand; |
13
|
|
|
use Nwidart\Modules\Commands\GenerateRouteProviderCommand; |
14
|
|
|
use Nwidart\Modules\Commands\InstallCommand; |
15
|
|
|
use Nwidart\Modules\Commands\ListCommand; |
16
|
|
|
use Nwidart\Modules\Commands\MakeCommand; |
17
|
|
|
use Nwidart\Modules\Commands\MakeRequestCommand; |
18
|
|
|
use Nwidart\Modules\Commands\MigrateCommand; |
19
|
|
|
use Nwidart\Modules\Commands\MigrateRefreshCommand; |
20
|
|
|
use Nwidart\Modules\Commands\MigrateResetCommand; |
21
|
|
|
use Nwidart\Modules\Commands\MigrateRollbackCommand; |
22
|
|
|
use Nwidart\Modules\Commands\MigrationCommand; |
23
|
|
|
use Nwidart\Modules\Commands\ModelCommand; |
24
|
|
|
use Nwidart\Modules\Commands\PublishCommand; |
25
|
|
|
use Nwidart\Modules\Commands\PublishMigrationCommand; |
26
|
|
|
use Nwidart\Modules\Commands\PublishTranslationCommand; |
27
|
|
|
use Nwidart\Modules\Commands\SeedCommand; |
28
|
|
|
use Nwidart\Modules\Commands\SeedMakeCommand; |
29
|
|
|
use Nwidart\Modules\Commands\SetupCommand; |
30
|
|
|
use Nwidart\Modules\Commands\UpdateCommand; |
31
|
|
|
use Nwidart\Modules\Commands\UseCommand; |
32
|
|
|
|
33
|
|
|
class ConsoleServiceProvider extends ServiceProvider |
34
|
|
|
{ |
35
|
|
|
protected $defer = false; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* The available commands |
39
|
|
|
* |
40
|
|
|
* @var array |
41
|
|
|
*/ |
42
|
|
|
protected $commands = [ |
43
|
|
|
MakeCommand::class, |
44
|
|
|
CommandCommand::class, |
45
|
|
|
ControllerCommand::class, |
46
|
|
|
DisableCommand::class, |
47
|
|
|
EnableCommand::class, |
48
|
|
|
GenerateMiddlewareCommand::class, |
49
|
|
|
GenerateProviderCommand::class, |
50
|
|
|
GenerateRouteProviderCommand::class, |
51
|
|
|
InstallCommand::class, |
52
|
|
|
ListCommand::class, |
53
|
|
|
MigrateCommand::class, |
54
|
|
|
MigrateRefreshCommand::class, |
55
|
|
|
MigrateResetCommand::class, |
56
|
|
|
MigrateRollbackCommand::class, |
57
|
|
|
MigrationCommand::class, |
58
|
|
|
ModelCommand::class, |
59
|
|
|
PublishCommand::class, |
60
|
|
|
PublishMigrationCommand::class, |
61
|
|
|
PublishTranslationCommand::class, |
62
|
|
|
SeedCommand::class, |
63
|
|
|
SeedMakeCommand::class, |
64
|
|
|
SetupCommand::class, |
65
|
|
|
UpdateCommand::class, |
66
|
|
|
UseCommand::class, |
67
|
|
|
DumpCommand::class, |
68
|
|
|
MakeRequestCommand::class, |
69
|
|
|
]; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Register the commands. |
73
|
|
|
*/ |
74
|
63 |
|
public function register() |
75
|
|
|
{ |
76
|
63 |
|
foreach ($this->commands as $command) { |
77
|
63 |
|
$this->commands($command); |
78
|
|
|
} |
79
|
63 |
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @return array |
83
|
|
|
*/ |
84
|
|
|
public function provides() |
85
|
|
|
{ |
86
|
|
|
$provides = []; |
87
|
|
|
|
88
|
|
|
foreach ($this->commands as $command) { |
89
|
|
|
$provides[] = $command; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
return $provides; |
93
|
|
|
} |
94
|
|
|
} |
95
|
|
|
|