This repository was archived by the owner on Feb 14, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 22
33namespace CodeWithDennis \FilamentTests \Concerns \Resources ;
44
5+ use Filament \Forms \Components \Field ;
56use Filament \Infolists \Components \Entry ;
67use Filament \Resources \Pages \EditRecord ;
78use Filament \Resources \Pages \ViewRecord ;
@@ -16,6 +17,20 @@ public function getResourceForm(): Schema
1617 ));
1718 }
1819
20+ public function getResourceFormFields (): array
21+ {
22+ return $ this ->getResourceForm ()->getFlatFields (true );
23+ }
24+
25+ public function getResourceFormFieldKeys (): array
26+ {
27+ return collect ($ this ->getResourceFormFields ())
28+ ->map (fn (Field $ field ) => $ field ->getName ())
29+ ->filter ()
30+ ->values ()
31+ ->all ();
32+ }
33+
1934 public function getResourceInfolist (): Schema
2035 {
2136 return $ this ->getResource ()->infolist (new Schema (
@@ -30,8 +45,12 @@ public function getResourceInfolistFields(): array
3045 ->all ();
3146 }
3247
33- public function getResourceFormFields (): array
48+ public function getResourceInfolistFieldKeys (): array
3449 {
35- return $ this ->getResourceForm ()->getFlatFields (true );
50+ return collect ($ this ->getResourceInfolistFields ())
51+ ->map (fn (Entry $ field ) => $ field ->getName ())
52+ ->filter ()
53+ ->values ()
54+ ->all ();
3655 }
3756}
You can’t perform that action at this time.
0 commit comments