public function updateCalendarEvent($id, array $data)
    {
        $eventData = $this->calendarEventsEngine->buildEventData($data);
        $eventDates = $this->calendarEventsEngine->buildEventDates($data);
        $cache = $this->cache;
        $calendarEventRepeatDate = clone $this->calendarEventRepeatDate;
        $calendarEventRepeatDate
            ->where('calendar_event_id', $id)
            ->delete()
        ;
        $this->calendarEvent
            ->where('id', $id)
            ->update($eventData)
        ;

        // This is necessary due to in some Laravel 5.1 versions there is no model hydration after update
        $calendarEvent = $this->calendarEvent
            ->where('id', $id)
            ->firstOrFail()
        ;
        $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->put($calendarEvent->id, $calendarEvent);
        $cache::put(self::ALL_EVENTS_KEY, $allEvents, $this->cacheTimeToLive);

        return true;
    }