public function init(Request $request) { $this->community = \App\RExpress\Models\Community\Community::with('communityHours')->find($request->get('communityId')); $this->templateRequests = $request->get('requests'); if (count($this->templateRequests) > 0) { return $this->getTemplates(); } }
public function maintenanceRequests() { $communityId = $_GET['communityId']; $community = Community\Community::with('maintenanceRequests')->find($communityId); $maintenanceRequests = []; foreach ($community->maintenanceRequests as $maintenanceRequest) { $maintenanceRequest->comments = $maintenanceRequest->comments; $maintenanceRequests[] = $maintenanceRequest; } return $maintenanceRequests; }
public function index($communityId, Responder $responder) { $community = Community\Community::with('communityHours')->with('enabledInterfaces')->find($communityId); return $responder->respondWithPayload($community); }