src/Services/CalendarEventsService.php
public function createCalendarEvent(array $data)
    {
        $eventData = $this->calendarEventsEngine->buildEventData($data);
        $eventDates = $this->calendarEventsEngine->buildEventDates($data);
        $cache = $this->cache;
        $calendarEvent = $this->calendarEvent->create($eventData);
        $this->handleEventLocation($data, $calendarEvent);

        foreach ($eventDates as $date) {
            $calendarEventRepeatDate = clone $this->calendarEventRepeatDate;
            $calendarEventRepeatDate->start = $date['start'];
            $calendarEventRepeatDate->end = $date['end'];
            $calendarEventRepeatDate->calendarEvent()
                                    ->associate($calendarEvent)
            ;
            $calendarEventRepeatDate->save();
            unset($calendarEventRepeatDate);
        }

        $cache::put(self::CACHE_KEY.$calendarEvent->id, $calendarEvent, $this->cacheTimeToLive);
        $allEvents = $this->getAllEvents();
        $allEvents[$calendarEvent->id] = $calendarEvent;
        $cache::put(self::ALL_EVENTS_KEY, $allEvents, $this->cacheTimeToLive);

        return true;
    }
public function createCalendarEvent(array $data)
    {
        $eventData = $this->calendarEventsEngine->buildEventData($data);
        $eventDates = $this->calendarEventsEngine->buildEventDates($data);
        $cache = $this->cache;
        $calendarEvent = $this->calendarEvent->create($eventData);
        $this->handleEventLocation($data, $calendarEvent);

        foreach ($eventDates as $date) {
            $calendarEventRepeatDate = clone $this->calendarEventRepeatDate;
            $calendarEventRepeatDate->start = $date['start'];
            $calendarEventRepeatDate->end = $date['end'];
            $calendarEventRepeatDate->calendarEvent()
                                    ->associate($calendarEvent)
            ;
            $calendarEventRepeatDate->save();
            unset($calendarEventRepeatDate);
        }

        $cache::put(self::CACHE_KEY.$calendarEvent->id, $calendarEvent, $this->cacheTimeToLive);
        $allEvents = $this->getAllEvents();
        $allEvents[$calendarEvent->id] = $calendarEvent;
        $cache::put(self::ALL_EVENTS_KEY, $allEvents, $this->cacheTimeToLive);

        return true;
    }
Creates calendar event

@param array $data

@return bool