Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Create Field

No security coverage
View on drupal.org

This module simplifies the process of creating fields in Drupal by providing a manager class that wraps Drush's field creation command. It allows developers to programmatically define various field properties like type, label, and options for specific entity types and bundles.

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.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Feb 2026
Latest release
6 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Core Release date
1.0.x-dev Dev 10–11 Feb 15, 2026