ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Arrilot\Api;
4
5
use Arrilot\Api\Generator\ApiMakeCommand;
6
7
class ServiceProvider extends \Illuminate\Support\ServiceProvider
8
{
9
    /**
10
     * Register the service provider.
11
     *
12
     * @return void
13
     */
14
    public function register()
15
    {
16
        $this->mergeConfigFrom(
17
            __DIR__.'/config/config.php', 'laravel-api-generator'
18
        );
19
20
        $this->app->singleton('command.api.make', function ($app) {
21
            return new ApiMakeCommand($app['files']);
22
        });
23
24
        $this->commands('command.api.make');
25
    }
26
27
    /**
28
     * Bootstrap the application events.
29
     */
30
    public function boot()
31
    {
32
        $this->publishes([
33
            __DIR__.'/config/config.php' => config_path('laravel-api-generator.php'),
34
        ]);
35
36
        require app_path(config('laravel-api-generator.routes_file'));
37
    }
38
}
39