33namespace Yassi \NestedForm ;
44
55use function GuzzleHttp \json_encode ;
6- use Illuminate \Support \Facades \Route ;
76use Illuminate \Support \Str ;
87use Illuminate \Validation \ValidationException ;
8+ use Laravel \Nova \Contracts \RelatableField ;
99use Laravel \Nova \Fields \BelongsTo ;
1010use Laravel \Nova \Fields \BelongsToMany ;
1111use Laravel \Nova \Fields \Field ;
2424
2525use Laravel \Nova \Panel ;
2626
27- class NestedForm extends Field
27+ class NestedForm extends Field implements RelatableField
2828{
2929
3030 /**
3131 * Wrap left.
32- *
32+ *
3333 * @var string
3434 */
3535 const WRAP_LEFT = '{{ ' ;
3636
3737 /**
3838 * Wrap right.
39- *
39+ *
4040 * @var string
4141 */
4242 const WRAP_RIGHT = '}} ' ;
4343
4444 /**
4545 * INDEX.
46- *
46+ *
4747 * @var string
4848 */
4949 const INDEX = 'INDEX ' ;
5050
5151 /**
5252 * ID.
53- *
53+ *
5454 * @var string
5555 */
5656 const ID = 'ID ' ;
@@ -78,85 +78,85 @@ class NestedForm extends Field
7878
7979 /**
8080 * The field's relationship resource class.
81- *
81+ *
8282 * @var string
8383 */
8484 public $ resourceClass ;
8585
8686 /**
8787 * The field's relationship resource name.
88- *
88+ *
8989 * @var string
9090 */
9191 public $ resourceName ;
9292
9393 /**
9494 * The field's relationship name.
95- *
95+ *
9696 * @var string
9797 */
9898 public $ viaRelationship ;
9999
100100 /**
101101 * The field's singular label.
102- *
102+ *
103103 * @var string
104104 */
105105 public $ singularLabel ;
106106
107107 /**
108108 * The field's plural label.
109- *
109+ *
110110 * @var string
111111 */
112112 public $ pluralLabel ;
113113
114114 /**
115115 * Default separator.
116- *
116+ *
117117 * @var string
118118 */
119119 public $ separator = '. ' ;
120120
121121 /**
122122 * From resource uriKey.
123- *
123+ *
124124 * @var string
125125 */
126126 public $ viaResource ;
127127
128128 /**
129129 * Key name.
130- *
130+ *
131131 * @var string
132132 */
133133 public $ keyName ;
134134
135135
136136 /**
137137 * Whether the form should be opened by default.
138- *
138+ *
139139 * @var boolean
140140 */
141141 public $ opened = true ;
142142
143143 /**
144144 * The heading template for children.
145- *
145+ *
146146 * @var string
147147 */
148148 public $ heading ;
149149
150150 /**
151151 * The maximum number of children.
152- *
152+ *
153153 * @var int
154154 */
155155 public $ max = 0 ;
156156
157157 /**
158158 * The minimum number of children.
159- *
159+ *
160160 * @var int
161161 */
162162 public $ min = 0 ;
@@ -168,7 +168,7 @@ class NestedForm extends Field
168168
169169 /**
170170 * Return context
171- *
171+ *
172172 * @var Panel|Field|NestedForm
173173 */
174174 protected $ returnContext ;
@@ -244,7 +244,7 @@ public function children($resource)
244244
245245 /**
246246 * Set the heading.
247- *
247+ *
248248 * @param string $heading
249249 */
250250 public function heading (string $ heading )
@@ -256,7 +256,7 @@ public function heading(string $heading)
256256
257257 /**
258258 * Set whether the form should be opened by default.
259- *
259+ *
260260 * @param boolean $opened
261261 */
262262 public function open (bool $ opened )
@@ -268,7 +268,7 @@ public function open(bool $opened)
268268
269269 /**
270270 * Set the default separator.
271- *
271+ *
272272 * @param string $separator
273273 */
274274 public function separator (string $ separator )
@@ -555,7 +555,7 @@ public static function make(...$arguments)
555555 /**
556556 * Wrap an attribute into a dynamic attribute
557557 * value.
558- *
558+ *
559559 * @param string $attribute
560560 * @param string $default
561561 */
@@ -565,9 +565,9 @@ public static function wrapAttribute(string $attribute, $default = '')
565565 }
566566
567567 /**
568- * Turn a given attribute string into
568+ * Turn a given attribute string into
569569 * a conditional attribute.
570- *
570+ *
571571 * @param string $attribute
572572 */
573573 public static function conditional (string $ attribute )
0 commit comments