Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

create_field

No security coverage
View on drupal.org

Takes the drush fc field:create and makes a class out of it called CreateFieldManager to simplify creating fields in a custom module. It exposes one public function fieldCreate(array $options) that takes the same array of options as the fieldCreate function in Drush\Commands\field\FieldCreateCommands.

Installation

Create a new Drupal installation to test. Add a biography content type. Download and install the module. There is a tester module that comes with it. It creates and deletes a field automatically when you hit the controller route so you know how to use it so make sure you have built a test environment.

If there is a need for this in Core I would love to see it end up there.

Options

entity-type
String
REQUIRED
The machine name of the entity type. bundle
String
REQUIRED
The machine name of the bundle. field-name
String
REQUIRED
A unique machine-readable name containing letters, numbers, and underscores. field-label
String
REQUIRED
The field label. field-description
String
OPTIONAL
Instructions to present to the user below this field on the editing form. field-type
String
REQUIRED
The field type. field-widget
String
OPTIONAL
The field widget. Will select the default widget automagically. is-required
Boolean
REQUIRED
Whether the field is required. is-translatable
Boolean
REQUIRED
Whether the field is translatable. cardinality
Integer
REQUIRED
The allowed number of values. target-type
String
OPTIONAL
The target entity type. Only necessary for entity reference fields. target-bundle
String
OPTIONAL
The target bundle(s). Only necessary for entity reference fields. show-machine-names
Boolean
REQUIRED
Show machine names instead of labels in option lists. existing-field-name
String
OPTIONAL
The name of an existing field you want to re-use. Only used in non-interactive context. existing
Boolean
REQUIRED
Re-use an existing field.

Activity

Total releases
1
First release
Feb 2026
Latest release
2 months ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.0.x-dev Dev Feb 15, 2026