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

NovaNavigaAdPreview::menuIcon()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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