forked from 64robots/nova-fields
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRow.php
More file actions
65 lines (56 loc) · 1.26 KB
/
Copy pathRow.php
File metadata and controls
65 lines (56 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
namespace R64\NovaFields;
use Laravel\Nova\Fields\Field;
class Row extends Field
{
use Configurable, HasChilds;
/**
* The field's component.
*
* @var string
*/
public $component = 'nova-fields-row';
/**
* Indicates if the element should be shown on the index view.
*
* @var bool
*/
public $showOnIndex = false;
/**
* The child fields.
*
* @var array
*/
public $fields = [];
/**
* Create a new JSON field.
*
* @param string $name
* @param string|null $attribute
* @param mixed|null $resolveCallback
* @return void
*/
public function __construct($name, $fields, $attribute = null, $resolveCallback = null)
{
parent::__construct($name, $attribute, $resolveCallback);
$this->withMeta(['fields' => $fields]);
}
/**
* Indicate that the heading should be hidden.
*
* @return $this
*/
public function hideHeading()
{
return $this->withMeta(['hideHeading' => true]);
}
/**
* Set text for Add Row button.
* @param string $name
* @return $this
*/
public function addRowText($text)
{
return $this->withMeta(['addRowText' => $text]);
}
}