LaranavServiceProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 41
ccs 0
cts 23
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 14 1
A register() 0 9 1
A provides() 0 4 1
1
<?php
2
3
namespace Larabros\Laranav;
4
5
use Illuminate\Http\Request;
6
use Illuminate\Support\ServiceProvider;
7
8
class LaranavServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * @inheritDoc
12
     */
13
    public function boot()
14
    {
15
        // Config files
16
        $this->publishes([
17
            __DIR__.'/config/config.php' => config_path('laranav/config.php'),
18
            __DIR__.'/config/menus.php'  => config_path('laranav/menus.php'),
19
        ], 'config');
20
21
        // Views
22
        $this->loadViewsFrom(__DIR__.'/../resources/views', 'laranav');
23
        $this->publishes([
24
            __DIR__.'/../resources/views' => base_path('resources/views/vendor/laranav'),
25
        ], 'views');
26
    }
27
28
    /**
29
     * @inheritDoc
30
     */
31
    public function register()
32
    {
33
        $this->mergeConfigFrom(__DIR__.'/config/config.php', 'laranav.config');
34
        $this->mergeConfigFrom(__DIR__.'/config/menus.php', 'laranav.menus');
35
36
        $this->app->singleton('nav', function ($app) {
37
            return new Manager($app);
38
        });
39
    }
40
41
    /**
42
     * @inheritDoc
43
     */
44
    public function provides()
45
    {
46
        return ['nav'];
47
    }
48
}
49