LicenseServiceProvider::boot()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 9.552
c 0
b 0
f 0
cc 3
nc 4
nop 0
1
<?php
2
3
namespace Tylercd100\License\Providers;
4
5
use Tylercd100\License\Commands\LicenseUpdate;
6
use Illuminate\Support\ServiceProvider;
7
8
class LicenseServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Register bindings in the container.
12
     *
13
     * @return void
14
     */
15
    public function register()
16
    {
17
        $this->mergeConfigFrom(__DIR__.'/../../config/licenses.php', 'licenses');
18
    }
19
20
    /**
21
     * Bootstrap any application services.
22
     *
23
     * @return void
24
     */
25
    public function boot()
26
    {
27
        // Config
28
        $this->publishes([
29
            __DIR__.'/../../config/licenses.php' => base_path('config/licenses.php'),
30
        ]);
31
32
        // Migrations
33
        if (method_exists($this, 'loadMigrationsFrom')) {
34
            $this->loadMigrationsFrom(__DIR__.'/../../migrations');
35
        } else {
36
            $this->publishes([
37
                __DIR__.'/../../migrations/' => database_path('migrations')
38
            ], 'migrations');
39
        }
40
41
        // Commands
42
        if ($this->app->runningInConsole()) {
43
            $this->commands([
44
                config('licenses.command_update'), // LicenseUpdate
45
            ]);
46
        }
47
    }
48
}