Passed
Pull Request — master (#93)
by Fèvre
20:30 queued 14:54
created

CategoryController::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 8
rs 10
c 1
b 0
f 0
1
<?php
2
namespace Xetaravel\Http\Controllers\Admin\Blog;
3
4
use Illuminate\Http\RedirectResponse;
5
use Illuminate\Http\Request;
6
use Illuminate\Support\Str;
7
use Illuminate\View\View;
8
use Xetaravel\Http\Controllers\Admin\Controller;
9
use Xetaravel\Models\Category;
10
use Xetaravel\Models\Repositories\CategoryRepository;
11
use Xetaravel\Models\Validators\CategoryValidator;
0 ignored issues
show
Bug introduced by
The type Xetaravel\Models\Validators\CategoryValidator was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
13
class CategoryController extends Controller
14
{
15
    /**
16
     * Constructor.
17
     */
18
    public function __construct()
19
    {
20
        parent::__construct();
21
22
        $this->breadcrumbs->addCrumb(
23
            '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 mr-2" fill="none"' .
24
            ' viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" ' .
25
            'stroke-linejoin="round" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2' .
26
            ' 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z" /></svg> Blog',
27
            route('admin.blog.article.index')
28
        );
29
    }
30
31
    /**
32
     * Show all categories.
33
     *
34
     * @return \Illuminate\View\View
35
     */
36
    public function index(): View
37
    {
38
        $this->breadcrumbs->addCrumb(
39
            '<i class="fa-solid fa-tags mr-2"></i> Manage Categories',
40
            route('admin.blog.category.index')
41
        );
42
43
        return view('Admin::Blog.category.index', ['breadcrumbs' => $this->breadcrumbs]);
44
    }
45
}
46