LaranavServiceProvider::provides()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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