Proper way to create image field in a content entity My site allows users to upload images and add title and description to it. So I make a new class which extends ContentEntityBase. In its baseFieldDefinitions() method, I put an image field beside title and description fields:

$fields['image'] = BaseFieldDefinition::create('image')
  -&gt;setLabel(t('Image'))
  -&gt;setRequired(TRUE);


I expect to see a file/image upload control in the add/edit form, but I don't see it. I see only the title and description textboxes.

I tried to find "create('image')" in all Drupal source code but didn't see any examples. So I don't know if creating an image field like this is the proper way or not?
See ...

$entity-&gt;getFieldDefinition('image')

'file_extensions' =&gt; string(16) "png gif jpg jpeg"
'file_directory' =&gt; string(31) "[date:custom:Y]-[date:custom:m]"


And edit

$fields['image'] = BaseFieldDefinition::create('image')
  -&gt;setLabel(t('Image'))
  -&gt;setDescription(t('Image field'))
  -&gt;setSettings([
    'file_directory' =&gt; 'IMAGE_FOLDER',
    'alt_field_required' =&gt; FALSE,
    'file_extensions' =&gt; 'png jpg jpeg',
  ])
 -&gt;setDisplayOptions('view', array(
    'label' =&gt; 'hidden',
    'type' =&gt; 'default',
    'weight' =&gt; 0,
  ))
  -&gt;setDisplayOptions('form', array(
    'label' =&gt; 'hidden',
    'type' =&gt; 'image_image',
    'weight' =&gt; 0,
  ))
  -&gt;setDisplayConfigurable('form', TRUE)
  -&gt;setDisplayConfigurable('view', TRUE);