Creating a calendar event from within a plugin (stuck on saving) I'm trying to create an event from within a plugin. I've come up with the following:
$event = new Event(); // Solspace\Calendar\Elements\Event;
$event-&gt;authorId = 1;
$event-&gt;calendarId = 5;
$event-&gt;name = 'Hello name';
$event-&gt;title = 'Hello title';
$event-&gt;startDate = new DateTime();
$event-&gt;endDate = new DateTime();
$event-&gt;allDay = true;

But I don't understand how to actually save the event (e.g. $event-&gt;save()). Am I on the right track or completely off? I couldn't find anything on this in the docs.
I got help on Discord. The way to do it was Calendar::getInstance()-&gt;events-&gt;saveEvent($event); Edit: DateTime also needs to be replaced with Carbon()