code: public function buildCustomFields($form_fields = [], $config_name = 'custom_form')
      {
          $fields = collect($form_fields)->map(function ($field, $name) use ($config_name) {
              return $this->render(
                  isset($field['type']) ? $field['type'] : 'text',
                  [
                      $name,
                      $field['label'],
                      ['data-table' => $config_name]
                  ]
              );
  
          });
  
          return $fields ;
  
      }
docs: Build fields from array
  
  @param array $form_fields [field_name => [label => Text field, type => password ]
  @param string $config_name
  @return mixed