Completed
Push — master ( cdb1c3...ab4554 )
by Prateek
04:40 queued 02:13
created

LaragenServiceProvider::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Prateekkarki\Laragen;
3
4
use Illuminate\Support\ServiceProvider;
5
use Prateekkarki\Laragen\Commands\Generate;
6
7
class LaragenServiceProvider extends ServiceProvider
8
{
9
    /**
10
     * Run on application loading
11
     */
12
    public function boot()
13
    {
14
        $this->publishes([
15
            __DIR__ . '/../config/laragen.php' => config_path('laragen.php')
16
        ], 'config');
17
    }
18
    /**
19
     * Run after all boot method completed
20
     */
21
    public function register()
22
    {
23
        $this->mergeConfigFrom(
24
            __DIR__ . '/../config/laragen.php',
25
            'laragen'
26
        );
27
28
        $this->app->bind('command.laragen:make', Generate::class);
29
30
        $this->commands([
31
            'command.laragen:make',
32
        ]);
33
34
    }
35
    /**
36
     * To register laragen as first level command. E.g. laragen:generate
37
     *
38
     * @return array
39
     */
40
    public function provides()
41
    {
42
        return ['laragen'];
43
    }
44
}
45