In drupal 8 I have created a bespoke content type... I now would like to create content of the bespoke content type via Php through user interaction. For example, the user clicks a button and it triggers a function in my module which I am creating.
I have used the following code:
$node = Node::create([
'type' => 'article',
'title' => 'My title',
]);
$node->save();
Which does create content in the content area of the admin panel, but... The content type column is empty?
Am sure someone will all ready have done this type of thing before so any help will be most welcomed.