File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/app/Library/CrudPanel Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,25 @@ public function upload($upload = true)
170170 return $ this ->save ();
171171 }
172172
173+ /**
174+ * When subfields are defined, pass them through the guessing function
175+ * so that they have label, relationship attributes, etc.
176+ *
177+ * @param array $subfields Subfield definition array
178+ * @return self
179+ */
180+ public function subfields ($ subfields )
181+ {
182+ $ callAttributeMacro = ! isset ($ this ->attributes ['subfields ' ]);
183+ $ this ->attributes ['subfields ' ] = $ subfields ;
184+ $ this ->attributes = $ this ->crud ()->makeSureColumnHasNeededAttributes ($ this ->attributes );
185+ if ($ callAttributeMacro ) {
186+ $ this ->callRegisteredAttributeMacros ();
187+ }
188+
189+ return $ this ->save ();
190+ }
191+
173192 /**
174193 * Make the current column the first one in the columns list.
175194 *
You can’t perform that action at this time.
0 commit comments