public function index($commuintyIds, Responder $responder) { $commuintyIds = explode(',', $commuintyIds); $news = []; $events = []; foreach ($commuintyIds as $id) { $communityNewsItems = Models\Community\CommunityNews::with('news')->where('iCommunityId', '=', $id)->get()->toArray(); foreach ($communityNewsItems as $item) { $news[] = $item; } } foreach ($commuintyIds as $id) { $communityEventItems = Models\Community\CommunityEvent::with('event')->where('iCommunityId', '=', $commuintyIds[0])->get()->toArray(); foreach ($communityEventItems as $item) { $events[] = $item; } } $merged = array_merge($news, $events); return $responder->respondWithPayload($merged); }
public function index($communityId, Responder $responder) { $community = Community\Community::with('communityHours')->with('enabledInterfaces')->find($communityId); return $responder->respondWithPayload($community); }
public function index($communityId, Responder $responder) { $contactFormLeads = Community\ContactFormLead::where('community_id', '=', $communityId)->get(); return $responder->respondWithPayload($contactFormLeads); }
public function index(Responder $responder) { return $responder->respondWithPayload(Community\Community::all()); }