LaravelSchematicsServiceProvider::boot()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.568
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Mtolhuys\LaravelSchematics;
4
5
use Illuminate\Support\ServiceProvider;
6
use Mtolhuys\LaravelSchematics\Console\Commands\Install;
7
8
class LaravelSchematicsServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Perform post-registration booting of services.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        if ($this->app->runningInConsole()) {
18
            $this->commands([
19
                Install::class,
20
            ]);
21
        }
22
23
        $this->loadRoutesFrom(__DIR__.'/routes.php');
24
25
        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'schematics');
26
27
        $this->publishes([
28
            __DIR__.'/../config/schematics.php' => config_path('schematics.php'),
29
        ]);
30
31
        $this->publishes([
32
            __DIR__.'/../dist' => public_path('vendor/schematics'),
33
            __DIR__.'/../resources/images/plumb-arrows' => public_path('vendor/schematics/images'),
34
            __DIR__.'/../resources/images/icons' => public_path('vendor/schematics/images'),
35
        ], 'public');
36
    }
37
38
    /**
39
     * Register any package services.
40
     *
41
     * @return void
42
     */
43
    public function register()
44
    {
45
        $this->mergeConfigFrom(__DIR__.'/../config/schematics.php', 'schematics');
46
    }
47
}
48