This commit is contained in:
philipp lang 2024-02-20 01:04:53 +01:00
parent 8713f941c1
commit c9cbf86626
1 changed files with 4 additions and 5 deletions

View File

@ -36,15 +36,14 @@ class ParticipantResource extends JsonResource
{ {
return [ return [
'active_columns' => $form->active_columns, 'active_columns' => $form->active_columns,
'columns' => $form->getFields()->map(function ($field) { 'columns' => $form->getFields()
$field = Field::fromConfig($field); ->map(fn ($field) => Field::fromConfig($field))
return [ ->map(fn ($field) => [
'name' => $field->name, 'name' => $field->name,
'base_type' => class_basename($field), 'base_type' => class_basename($field),
'id' => $field->key, 'id' => $field->key,
'display_attribute' => $field->getdisplayAttribute(), 'display_attribute' => $field->getdisplayAttribute(),
]; ])
})
]; ];
} }
} }