Field settings
When we created our field type, we specified some storage settings, and we saw that these are typically linked to underlying storage and cannot be changed once the field has data in it. This is because databases have a hard time making table column changes when there is data present in them. However, apart from storage settings, we also have something called field settings, which are specific to the field instance on a certain entity bundle. Even more, they can (or should) be changeable even after the field has been created and has data in it. An example of such a field setting, which is available from Drupal core on all field types, is the “required” option, which marks a field as required or not. So, let’s see how we can add our own field settings to configure what we said we wanted to do.
Back in our LicensePlateItem
plugin class, we start by adding the default field settings:
/** * {@inheritdoc} */ public static function defaultFieldSettings...