© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago
Raj Siva-Rajah

Displaying different form schemas depending on a $record attribute

Hi all

I need to display different form schemas for a resource depending on the value of the current record's
group
group
attribute. I'm currently doing it like this:

->schema(function (Model $record) {
   $group = $record->group;

   // match statements for each group
->schema(function (Model $record) {
   $group = $record->group;

   // match statements for each group


Just wondering how other people handle this? Not sure if there's a cleaner way
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Displaying related data on form fields from deleted record.
FilamentFFilament / ❓┊help
3y ago
Different form components depending on whether it is editing or creating.
FilamentFFilament / ❓┊help
3y ago
Nesting form fields depending on relationships
FilamentFFilament / ❓┊help
2y ago
Show different records depending on user roles
FilamentFFilament / ❓┊help
2y ago