1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Caffeinated\Modules\Providers; |
4
|
|
|
|
5
|
|
|
use Illuminate\Support\ServiceProvider; |
6
|
|
|
|
7
|
|
|
class GeneratorServiceProvider extends ServiceProvider |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* Bootstrap the application services. |
11
|
|
|
*/ |
12
|
|
|
public function boot() |
13
|
|
|
{ |
14
|
|
|
// |
15
|
|
|
} |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Register the application services. |
19
|
|
|
*/ |
20
|
|
|
public function register() |
21
|
|
|
{ |
22
|
|
|
$this->registerMakeControllerCommand(); |
23
|
|
|
$this->registerMakeMiddlewareCommand(); |
24
|
|
|
$this->registerMakeMigrationCommand(); |
25
|
|
|
$this->registerMakeModelCommand(); |
26
|
|
|
$this->registerMakeModuleCommand(); |
27
|
|
|
$this->registerMakeRequestCommand(); |
28
|
|
|
$this->registerMakeSeederCommand(); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Register the make:module:controller command. |
33
|
|
|
*/ |
34
|
|
|
private function registerMakeControllerCommand() |
35
|
|
|
{ |
36
|
|
|
$this->app->singleton('command.make.module.controller', function ($app) { |
37
|
|
|
return $app['Caffeinated\Modules\Console\Generators\MakeControllerCommand']; |
38
|
|
|
}); |
39
|
|
|
|
40
|
|
|
$this->commands('command.make.module.controller'); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Register the make:module:middleware command. |
45
|
|
|
*/ |
46
|
|
|
private function registerMakeMiddlewareCommand() |
47
|
|
|
{ |
48
|
|
|
$this->app->singleton('command.make.module.middleware', function ($app) { |
49
|
|
|
return $app['Caffeinated\Modules\Console\Generators\MakeMiddlewareCommand']; |
50
|
|
|
}); |
51
|
|
|
|
52
|
|
|
$this->commands('command.make.module.middleware'); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Register the make:module:migration command. |
57
|
|
|
*/ |
58
|
|
|
private function registerMakeMigrationCommand() |
59
|
|
|
{ |
60
|
|
|
$this->app->singleton('command.make.module.migration', function ($app) { |
61
|
|
|
return $app['Caffeinated\Modules\Console\Generators\MakeMigrationCommand']; |
62
|
|
|
}); |
63
|
|
|
|
64
|
|
|
$this->commands('command.make.module.migration'); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Register the make:module:model command. |
69
|
|
|
*/ |
70
|
|
|
private function registerMakeModelCommand() |
71
|
|
|
{ |
72
|
|
|
$this->app->singleton('command.make.module.model', function ($app) { |
73
|
|
|
return $app['Caffeinated\Modules\Console\Generators\MakeModelCommand']; |
74
|
|
|
}); |
75
|
|
|
|
76
|
|
|
$this->commands('command.make.module.model'); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Register the make:module command. |
81
|
|
|
*/ |
82
|
|
|
private function registerMakeModuleCommand() |
83
|
|
|
{ |
84
|
|
|
$this->app->singleton('command.make.module', function ($app) { |
85
|
|
|
return $app['Caffeinated\Modules\Console\Generators\MakeModuleCommand']; |
86
|
|
|
}); |
87
|
|
|
|
88
|
|
|
$this->commands('command.make.module'); |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Register the make:module:request command. |
93
|
|
|
*/ |
94
|
|
|
private function registerMakeRequestCommand() |
95
|
|
|
{ |
96
|
|
|
$this->app->singleton('command.make.module.request', function ($app) { |
97
|
|
|
return $app['Caffeinated\Modules\Console\Generators\MakeRequestCommand']; |
98
|
|
|
}); |
99
|
|
|
|
100
|
|
|
$this->commands('command.make.module.request'); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* Register the make:module:seeder command. |
105
|
|
|
*/ |
106
|
|
|
private function registerMakeSeederCommand() |
107
|
|
|
{ |
108
|
|
|
$this->app->singleton('command.make.module.seeder', function ($app) { |
109
|
|
|
return $app['Caffeinated\Modules\Console\Generators\MakeSeederCommand']; |
110
|
|
|
}); |
111
|
|
|
|
112
|
|
|
$this->commands('command.make.module.seeder'); |
113
|
|
|
} |
114
|
|
|
} |
115
|
|
|
|