CategoryController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 9 1
A __construct() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Xetaravel\Http\Controllers\Admin\Discuss;
6
7
use Illuminate\View\View;
8
use Xetaravel\Http\Controllers\Admin\Controller;
9
10
class CategoryController extends Controller
11
{
12
    /**
13
     * Constructor.
14
     */
15
    public function __construct()
16
    {
17
        parent::__construct();
18
19
        $this->breadcrumbs->addCrumb(
20
            '<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z"></path></svg>
21
                          Discuss',
22
            route('admin.discuss.category.index')
23
        );
24
    }
25
26
    /**
27
     * Show all categories.
28
     *
29
     * @return View
30
     */
31
    public function index(): View
32
    {
33
        $this->breadcrumbs->addCrumb(
34
            '<svg class="w-5 h-5 mr-2" fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M345 39.1L472.8 168.4c52.4 53 52.4 138.2 0 191.2L360.8 472.9c-9.3 9.4-24.5 9.5-33.9 .2s-9.5-24.5-.2-33.9L438.6 325.9c33.9-34.3 33.9-89.4 0-123.7L310.9 72.9c-9.3-9.4-9.2-24.6 .2-33.9s24.6-9.2 33.9 .2zM0 229.5L0 80C0 53.5 21.5 32 48 32l149.5 0c17 0 33.3 6.7 45.3 18.7l168 168c25 25 25 65.5 0 90.5L277.3 442.7c-25 25-65.5 25-90.5 0l-168-168C6.7 262.7 0 246.5 0 229.5zM144 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"></path></svg>
35
                        Manage Categories',
36
            route('admin.discuss.category.index')
37
        );
38
39
        return view('Admin::Discuss.category.index', ['breadcrumbs' => $this->breadcrumbs]);
40
    }
41
}
42