Adding database entry from panel (comments example from the guide)

I found the solution here in an old topic. When inserting you have to mention every field, even if empty. Quite confusing and i didn’t find a single hint in the docs.

so change this:

$data['slug'] = $this->slug();
return Db::insert('comments', $data);

to this:

return Db::insert('comments', [
				'slug'  => $this->slug(),
				'text'  => '',
				'user'  => '',
				'title'  => '',
				'status'  => ''
]);

and it works.

Now i can adapt to my needs.