Completed
Push — master ( 2dffbe...813169 )
by Jose Luis
14:24
created

MenuServiceProvider::boot()   B

Complexity

Conditions 4
Paths 8

Size

Total Lines 22
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 2 Features 1
Metric Value
c 4
b 2
f 1
dl 0
loc 22
rs 8.9197
cc 4
eloc 13
nc 8
nop 0
1
<?php
2
3
namespace Hechoenlaravel\JarvisFoundation\Providers;
4
5
use MenuPing;
6
use Illuminate\Support\ServiceProvider;
7
8
class MenuServiceProvider extends ServiceProvider
9
{
10
    /**
11
     * Bootstrap the application services.
12
     *
13
     * @return void
14
     */
15
    public function boot()
16
    {
17
        if (!MenuPing::instance('sidebar')) {
18
            MenuPing::create('sidebar', function ($menu) {
19
                $menu->enableOrdering();
20
                $menu->setPresenter('Hechoenlaravel\JarvisFoundation\Menu\Presenters\SidebarMenuPresenter');
21
            });
22
        }
23
        if (!MenuPing::instance('config')) {
24
            MenuPing::create('config', function ($menu) {
25
                $menu->dropdown('Configuración', function ($sub) {
0 ignored issues
show
Unused Code introduced by
The parameter $sub is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26
27
                }, ['icon' => 'fa fa-cogs']);
28
                $menu->setPresenter('Hechoenlaravel\JarvisFoundation\Menu\Presenters\SidebarMenuPresenter');
29
            });
30
        }
31
        if (!MenuPing::instance('topnav')) {
32
            MenuPing::create('topnav', function ($menu) {
33
                $menu->enableOrdering();
34
            });
35
        }
36
    }
37
38
    /**
39
     * Register the application services.
40
     *
41
     * @return void
42
     */
43
    public function register()
44
    {
45
        //
46
    }
47
}
48