1 | <?php |
||
2 | |||
3 | namespace OkayBueno\ServiceGenerator; |
||
4 | |||
5 | use Illuminate\Support\ServiceProvider; |
||
6 | |||
7 | /** |
||
8 | * Class ServiceGeneratorServiceProvider |
||
9 | * @package OkayBueno\ServiceGenerator |
||
10 | */ |
||
11 | class ServiceGeneratorServiceProvider extends ServiceProvider |
||
12 | { |
||
13 | |||
14 | private $configPath = '/config/service-generator.php'; |
||
15 | |||
16 | |||
17 | /** |
||
18 | * |
||
19 | */ |
||
20 | public function boot() |
||
21 | { |
||
22 | $this->publishes([ |
||
23 | __DIR__.$this->configPath => config_path('service-generator.php'), |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
24 | ], 'service-generator'); |
||
25 | } |
||
26 | |||
27 | |||
28 | /** |
||
29 | * |
||
30 | */ |
||
31 | public function register() |
||
32 | { |
||
33 | // merge default config |
||
34 | $this->mergeConfigFrom( |
||
35 | __DIR__.$this->configPath , 'repositories' |
||
36 | ); |
||
37 | |||
38 | // And generators. |
||
39 | $this->registerServiceGenerator(); |
||
40 | } |
||
41 | |||
42 | |||
43 | /** |
||
44 | * |
||
45 | */ |
||
46 | private function registerServiceGenerator() |
||
47 | { |
||
48 | $this->app->singleton('command.service', function ($app) |
||
49 | { |
||
50 | return $app['OkayBueno\ServiceGenerator\Commands\MakeServiceCommand']; |
||
51 | }); |
||
52 | |||
53 | $this->commands('command.service'); |
||
54 | } |
||
55 | |||
56 | } |