/** * Show the form for creating a new resource. * * @return Response */ public function create($prereq_id) { $prereq = PreReq::find($prereq_id); $unidades = Unidad::all(); $data['prereq'] = $prereq; foreach ($unidades as $unidad) { $arr_unidades[$unidad->tipo][$unidad->unidad] = $unidad->unidad; } $data['unidades'] = $arr_unidades; return view('prereqs.formPreReqArticulo')->with($data); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $prereq = PreReq::find($id); $prereq->fecha = Carbon::parse($prereq->fecha)->format('d/m/Y'); $articulos = PreReqArticulo::wherePreReqId($id)->get(); $data['prereq'] = $prereq; if (isset($articulos)) { $data['articulos'] = $articulos; } else { $data['articulos'] = array(); } return view('prereqs.infoPreRequisicion')->with($data); }