ServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace LaravelPropertyBag;
4
5
use Illuminate\Support\ServiceProvider as BaseProvider;
6
7
class ServiceProvider extends BaseProvider
8
{
9
    /**
10
     * Register bindings in the container.
11
     *
12
     * @return void
13
     */
14
    public function register()
15
    {
16
        $this->registerCommands();
17
    }
18
19
    /**
20
     * Register any other events for your application.
21
     *
22
     * @return void
23
     */
24
    public function boot()
25
    {
26
        $this->publishes([
27
            __DIR__.'/Migrations/' => database_path('migrations'),
28
        ], 'migrations');
29
    }
30
31
    /**
32
     * Register Artisan commands.
33
     */
34
    protected function registerCommands()
35
    {
36
        $this->app->singleton('command.pbag.make', function ($app) {
37
            return $app['LaravelPropertyBag\Commands\PublishSettingsConfig'];
38
        });
39
40
        $this->app->singleton('command.pbag.rules', function ($app) {
41
            return $app['LaravelPropertyBag\Commands\PublishRulesFile'];
42
        });
43
44
        $this->commands('command.pbag.make');
45
46
        $this->commands('command.pbag.rules');
47
    }
48
}
49