Controller   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 26
dl 0
loc 54
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 49 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Xetaravel\Http\Controllers\Admin;
6
7
use Xetaravel\Http\Controllers\Controller as BaseController;
8
use Xety\Breadcrumbs\Breadcrumbs;
9
10
class Controller extends BaseController
11
{
12
    /**
13
     * Constructor.
14
     */
15
    public function __construct()
16
    {
17
        parent::__construct();
18
19
        $this->breadcrumbs = new Breadcrumbs([], [
20
            // Whether to enable or not the `data-position` attribute.
21
            'position' => false,
22
            // The divider symbol between the crumbs or `null` to disable it.
23
            'divider' => '<svg class="h-4 w-4" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"></path></svg>',
24
            // The DOM-Element used to generate the divider element.
25
            'dividerElement' => 'li',
26
            // Classes applied to the item `dividerElement` element.
27
            'dividerElementClasses' => [
28
                'inline-flex items-center'
29
            ],
30
            // The DOM-Element used to generate the container element.
31
            'listRootElement' => 'nav',
32
            // Classes applied to the main `listElement` container element.
33
            'listRootElementClasses' => [
34
                'flex p-3 px-5 bg-base-100 dark:bg-base-300 shadow-md rounded-lg mb-3 truncate'
35
            ],
36
            // The DOM-Element used to generate the container element.
37
            'listElement' => 'ol',
38
            // Classes applied to the main `listElement` container element.
39
            'listElementClasses' => [
40
                'inline-flex items-center space-x-1 md:space-x-3'
41
            ],
42
            // The DOM-Element used to generate the list item.
43
            'listItemElement' => 'li',
44
            // Classes applied to the list item `listItemElement` element.
45
            'listItemElementClasses' => [
46
                'inline-flex items-center'
47
            ],
48
            // The DOM-Element used to generate the list item.
49
            'listItemLinkElement' => 'a',
50
            // Classes applied to the list item `listItemElement` element.
51
            'listItemLinkElementClasses' => [
52
                'text-sm inline-flex items-center dark:hover:text-white link-hover'
53
            ],
54
            // The DOM-Element used to generate the active list item.
55
            'listActiveElement' => 'li',
56
            // Classes applied to the active item `listActiveElement` element.
57
            'listActiveElementClasses' => [
58
                'text-sm text-gray-400 inline-flex items-center dark:text-gray-500 ml-1 font-medium'
59
            ]
60
        ]);
61
        $this->breadcrumbs->addCrumb(
62
            '<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 mr-2 fill-current" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"></path></svg> Dashboard',
63
            route('admin.page.index')
64
        );
65
    }
66
}
67