public function suspensiones_fecha($fecha_id) { $result["result"] = "Error"; if ($fecha_id == '') { $fecha_id = Input::get("fecha_id"); } $partidos = Partido::where("fecha_id", $fecha_id)->get(); //dd($partidos); $fecha_id = (int) $fecha_id; if ($fecha_id != null) { $suspension = Suspension::with('socio')->with('estado')->with('evento')->with('evento.partido.fecha.torneo.temporada')->with('evento.tipo_evento')->with('partido')->with('tipo')->whereHas('evento', function ($q) use($fecha_id) { $q->whereHas('partido', function ($subq) use($fecha_id) { $subq->where("fecha_id", $fecha_id); }); })->get(); if ($suspension != null) { $result["result"] = "Ok"; $result["response"] = $suspension; } else { $result["description"] = "No existe suspension con tal id"; } } return $result; }