RegisterBlockSidebar   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A extendWith() 0 19 1
1
<?php
2
3
namespace Modules\Block\Events\Handlers;
4
5
use Maatwebsite\Sidebar\Group;
6
use Maatwebsite\Sidebar\Item;
7
use Maatwebsite\Sidebar\Menu;
8
use Modules\Core\Sidebar\AbstractAdminSidebar;
9
10
class RegisterBlockSidebar extends AbstractAdminSidebar
11
{
12
    /**
13
     * Method used to define your sidebar menu groups and items
14
     * @param Menu $menu
15
     * @return Menu
16
     */
17
    public function extendWith(Menu $menu)
18
    {
19
        $menu->group(trans('core::sidebar.content'), function (Group $group) {
20
            $group->item(trans('block::blocks.title.blocks'), function (Item $item) {
21
                $item->authorize(
22
                    $this->auth->hasAccess('block.blocks.index')
23
                );
24
                $item->icon('fa fa-cube');
25
                $item->weight(config('asgard.block.config.sidebar-position', 15));
26
                $item->append('admin.block.block.create');
27
                $item->route('admin.block.block.index');
28
                $item->authorize(
29
                    $this->auth->hasAccess('block.blocks.index')
30
                );
31
            });
32
        });
33
34
        return $menu;
35
    }
36
}
37