/** * Get a list of every event in Joind.in that doesn't exist in our system * * @return array */ protected function listUnsyncedEvents() { $return = []; $conferences = $this->client->getEvents(); $alreadyConferences = \Conference::all(); $joindinIds = $alreadyConferences->map(function ($conference) { return (int) $conference->joindin_id; }); $joindinIdsArray = $joindinIds->toArray(); // @todo this should be a lot simpler if we can get the Collection working foreach ($conferences as $conference) { if (!in_array($conference['id'], $joindinIdsArray)) { $return[] = $conference; } } return $return; }