Programmatically (via php code) create content of a specified type 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'        =&gt; 'article',
  'title'       =&gt; 'My title',
   ]);
   $node-&gt;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.
Thanks Ivan Jaros and Kevin ... Once I placed the machine name of the content type (rather than it's human readable title) as the type value the content created successful and was of the required type e.g.

$node = Node::create([
    'type'        =&gt; 'the machine name associated with the content type',
    'title'       =&gt; 'My title',
   ]);
 $node-&gt;save();