GPTTarget::fields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 17
ccs 0
cts 16
cp 0
rs 9.8333
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace NovaAdDirector\Nova\Flexible\Layouts;
4
5
use Laravel\Nova\Fields\Text;
6
use NovaFlexibleContent\Layouts\Layout;
7
8
class GPTTarget extends Layout
9
{
10
    protected string $name = 'gpt-target';
11
12
    protected string $title = 'gpt-target';
13
14
    public function title(): string
15
    {
16
        return trans("nova-ad-director::resource.layouts.{$this->name}");
17
    }
18
19
    public function fields(): array
20
    {
21
        return [
22
            Text::make(
23
                trans("nova-ad-director::resource.configuration.{$this->name}.target_key"),
24
                'target_key'
25
            )
26
                ->placeholder('Sponsor_Ad_Targets')
27
                ->rules('required')
28
                ->help(trans("nova-ad-director::resource.configuration.{$this->name}.help_target_key")),
29
            Text::make(
30
                trans("nova-ad-director::resource.configuration.{$this->name}.target_value"),
31
                'target_value'
32
            )
33
                ->placeholder('Sponsor1,Sponsor2')
34
                ->rules('required')
35
                ->help(trans("nova-ad-director::resource.configuration.{$this->name}.help_target_value")),
36
        ];
37
    }
38
}
39