function ofertasByUsuario(Request $request, Response $response) { $response = $response->withHeader('Content-type', 'application/json'); $id = $request->getAttribute('id'); $data = Oferta::where("idUsuario", "=", $id)->get(); if (count($data) == 0) { $response = $response->withStatus(404); } $response->getBody()->write($data); return $response; }
public function getOfertasComp() { return Oferta::where('area_empleo', '=', $this->areaEmpleo_id)->get(); }