using associative array for table/form schema array

is there any concern in using associative array for form/table schema, eg:
// default form schema
function defaultRegistrationForm(){
  return [
    'name' => TextInput::make('name'),
    'email' => TextInput::make('email'),
  ];
}

function getRegistrationFormSchema(){
  // handle form schema customization
}

// form
$form->schema($this->getRegistrationFormSchema())


and then I will have some api to customize the schema fields, eg:
  RegistrationForm::add(fn() => ['mobile' => TextInput::make('mobile'));
  RegistrationForm::before('name', ['salutation => ...]);


this may also extend to any methods in filament that return array such as getHeaderActions array etc


is this a pattern that Filament would advise against with?
Solution
i cant imagine any immediate issues, but i cannot guarantee that the key will not be lost at some point in the form process and replaced with a nunber
Was this page helpful?