/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { if (count(ReclamoCausa::where('causa_id', $id)->get()) > 0) { return new AjaxResponse('error', 'Esta causa ya ha sido asignada a uno o más reclamos. Imposible eliminar'); } $record = Causa::find($id)->delete(); return new AjaxResponse('success', ''); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $record = ReclamoCausa::find($id)->delete(); return new AjaxResponse('success', ''); }