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 attribute. I'm currently doing it like this:

->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
Was this page helpful?