File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 44
55use Closure ;
66use Filament \Forms \Components \Field ;
7+ use Filament \Forms \Components \Hidden ;
78use Filament \Forms \Components \Select ;
89use Filament \Forms \Components \TextInput ;
910use Filament \Schemas \Components \Concerns \HasLabel ;
@@ -106,8 +107,13 @@ protected function buildSchema(): array
106107 $ googleFields = $ this ->getFormattedApiResults ($ data );
107108
108109 foreach ($ this ->getWithFields () as $ field ) {
109- $ fieldExtraAttributes = $ field ->getExtraInputAttributes ();
110+ // Check if the field is a Hidden component or has getExtraInputAttributes method
111+ $ fieldExtraAttributes = $ field instanceof Hidden
112+ ? $ field ->getExtraAttributes ()
113+ : $ field ->getExtraInputAttributes ();
114+
110115 $ googleFieldName = count ($ fieldExtraAttributes ) > 0 && isset ($ fieldExtraAttributes ['data-google-field ' ]) ? $ fieldExtraAttributes ['data-google-field ' ] : $ field ->getName ();
116+
111117 $ googleFieldValue = count ($ fieldExtraAttributes ) > 0 && isset ($ fieldExtraAttributes ['data-google-value ' ]) ? $ fieldExtraAttributes ['data-google-value ' ] : 'long_name ' ;
112118
113119 // if the field contains combined values
You can’t perform that action at this time.
0 commit comments