Passed
Push — main ( 021ea8...bae248 )
by Yaroslav
02:48
created

NovaNavigaAdPreview   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 46.15%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 12
c 1
b 0
f 0
dl 0
loc 35
ccs 6
cts 13
cp 0.4615
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A menu() 0 5 1
A boot() 0 4 1
A menuName() 0 5 1
A menuIcon() 0 5 1
1
<?php
2
3
namespace NovaNavigaAdPreview;
4
5
use Illuminate\Http\Request;
6
use Laravel\Nova\Menu\MenuSection;
7
use Laravel\Nova\Nova;
8
use Laravel\Nova\Tool;
9
10
class NovaNavigaAdPreview extends Tool
11
{
12
    protected string $menuName = 'Naviga ad preview';
13
    protected string $menuIcon = 'photograph';
14
15
    /**
16
     * Perform any tasks that need to happen when the tool is booted.
17
     *
18
     * @return void
19
     */
20
    public function boot()
21
    {
22
        Nova::script('nova-naviga-ad-preview', __DIR__ . '/../dist/js/tool.js');
23
        Nova::style('nova-naviga-ad-preview', __DIR__ . '/../dist/css/tool.css');
24
    }
25
26
    public function menu(Request $request)
27
    {
28
        return MenuSection::make($this->menuName)
29
            ->path('/nova-naviga-ad-preview')
30
            ->icon($this->menuIcon);
31
    }
32
33 2
    public function menuIcon(string $menuIcon): static
34
    {
35 2
        $this->menuIcon = $menuIcon;
36
37 2
        return $this;
38
    }
39
40 2
    public function menuName(string $menuName): static
41
    {
42 2
        $this->menuName = $menuName;
43
44 2
        return $this;
45
    }
46
}
47