Total Complexity | 4 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class ShortcodeText extends Field |
||
12 | { |
||
13 | /** |
||
14 | * The field's component. |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | public $component = 'shortcode-text'; |
||
19 | |||
20 | 1 | public function shortcodeKeyName(string $value) |
|
21 | { |
||
22 | 1 | $this->withMeta([ |
|
23 | 1 | 'shortcodeKeyName' => $value, |
|
24 | 1 | ]); |
|
25 | |||
26 | 1 | return $this; |
|
27 | } |
||
28 | |||
29 | 2 | public function meta() |
|
30 | { |
||
31 | 2 | $meta = $this->meta; |
|
32 | 2 | if (empty($meta['shortcodeKeyName'])) { |
|
33 | 1 | $meta['shortcodeKeyName'] = config('nfc-shortcode.key'); |
|
34 | } |
||
35 | |||
36 | 2 | return $meta; |
|
37 | } |
||
38 | |||
39 | /** |
||
40 | * @param NovaRequest $request |
||
41 | * @param object $model |
||
42 | * |
||
43 | * @return mixed|void |
||
44 | */ |
||
45 | 1 | public function fill(NovaRequest $request, $model) |
|
47 | // nothing |
||
48 | 1 | } |
|
49 | } |
||
50 |