I am trying to update a node image field programmatically. I currently loading the node like this:
$node = Node::Load(1);
have the URI if the image that I want to set. I have tried this but no luck:
$node->set('field_image_head', array('#uri' => $imageUri));
- How do I now update the node image with an image URI?
- The twig will need to get the URL from the image field like so
{{ file_url(node.field_image_head.entity.fileuri}}