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
->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
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server