Controller   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 29
dl 0
loc 63
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 47 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Xetaravel\Http\Controllers;
6
7
use Illuminate\Foundation\Bus\DispatchesJobs;
8
use Illuminate\Routing\Controller as BaseController;
9
use Illuminate\Foundation\Validation\ValidatesRequests;
10
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
11
use Xety\Breadcrumbs\Breadcrumbs;
12
13
class Controller extends BaseController
14
{
15
    use AuthorizesRequests;
16
    use DispatchesJobs;
17
    use ValidatesRequests;
18
19
    /**
20
     * The current Breadcrumbs instance.
21
     *
22
     * @var Breadcrumbs
23
     */
24
    protected Breadcrumbs $breadcrumbs;
25
26
    /**
27
     * Constructor.
28
     */
29
    public function __construct()
30
    {
31
        $this->breadcrumbs = new Breadcrumbs([], [
32
            // Whether to enable or not the `data-position` attribute.
33
            'position' => false,
34
            // The divider symbol between the crumbs or `null` to disable it.
35
            '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>',
36
            // The DOM-Element used to generate the divider element.
37
            'dividerElement' => 'li',
38
            // Classes applied to the item `dividerElement` element.
39
            'dividerElementClasses' => [
40
                'inline-flex items-center'
41
            ],
42
            // The DOM-Element used to generate the container element.
43
            'listRootElement' => 'nav',
44
            // Classes applied to the main `listElement` container element.
45
            'listRootElementClasses' => [
46
                'flex p-3 px-5 rounded-lg bg-base-100 dark:bg-base-300 shadow-md mb-3 truncate'
47
            ],
48
            // The DOM-Element used to generate the container element.
49
            'listElement' => 'ol',
50
            // Classes applied to the main `listElement` container element.
51
            'listElementClasses' => [
52
                'inline-flex items-center space-x-1 md:space-x-3'
53
            ],
54
            // The DOM-Element used to generate the list item.
55
            'listItemElement' => 'li',
56
            // Classes applied to the list item `listItemElement` element.
57
            'listItemElementClasses' => [
58
                'inline-flex items-center'
59
            ],
60
            // The DOM-Element used to generate the list item.
61
            'listItemLinkElement' => 'a',
62
            // Classes applied to the list item `listItemElement` element.
63
            'listItemLinkElementClasses' => [
64
                'text-sm inline-flex items-center dark:hover:text-white link-hover'
65
            ],
66
            // The DOM-Element used to generate the active list item.
67
            'listActiveElement' => 'li',
68
            // Classes applied to the active item `listActiveElement` element.
69
            'listActiveElementClasses' => [
70
                'text-sm text-gray-400 inline-flex items-center ml-1 font-medium'
71
            ]
72
        ]);
73
        $this->breadcrumbs->addCrumb(
74
            '<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 mr-2" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" stroke="currentColor"><path d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path></svg> Home',
75
            route('page.index')
76
        );
77
    }
78
}
79