Retrieve the default image from an image field programatically Currently im using the following code to retrieve the uri of an image field:

$field = $paragraph-&gt;field_background_image_left;
$uri = $field-&gt;entity-&gt;getFileUri();


This seems to work fine when the field contains a value.
But when no value is set, '$field->entity' will contain null, even when a default image was set for this field.

How do I retrieve the uri of the default image from my field?
The default image is stored in field configuration. You can retrieve it as follows:

&lt;?php

use Drupal\field\Entity\FieldConfig;

$field_info = FieldConfig::loadByName('node', 'article', 'field_image');
$image_uuid = $field_info-&gt;getSetting('default_image')['uuid'];
$image = Drupal::service('entity.repository')-&gt;loadEntityByUuid('file', $image_uuid);
$image_uri = $image-&gt;getFileUri();