Hi team i have some isssues.
I'm creating a node and i would like to set a content reference by name not by id, i'm doing this but this is not working: 'field_content_type_items' is referenced to another content type
$node = \Drupal\node\Entity\Node::create([ 'type' => 'items', 'status' => $status, 'title' => $title, 'field_content_type_items' => "CUN", ]);
Also i tried with this example
'field_content_type_items' => [['target_id' => 12]], but i dont know the id for
CUN so i cant use
also i've tried:
could you please help me?
How can i set a content name when i create a node?