public function destroy($id) { $response = new GenericResponse(); $contactFormLead = Community\ContactFormLead::find($id); if (is_null($contactFormLead)) { $response->fails = true; $response->messages = ['DB', 'Record Doesn\'t Exist']; return $response->json(); } if (!$contactFormLead->delete()) { $response->fails = true; $response->messages = ['DB', 'Probelm deleting record. Please try again']; } return $response->json(); }
public function index($communityId, Responder $responder) { $contactFormLeads = Community\ContactFormLead::where('community_id', '=', $communityId)->get(); return $responder->respondWithPayload($contactFormLeads); }