public function crearServicio() { $tipo = TipoServicio::lists('nombre', 'id')->all(); $cliente = array(Auth::user()->id => Auth::user()->nombre); $tecnico = User::where('nivel', 'tecnico')->lists('nombre', 'id'); return view('cliente.crear_servicio')->with('cliente', $cliente)->with('tecnico', $tecnico)->with('tipo', $tipo); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { if (Auth::user()->nivel === 'cliente') { return redirect('inicioCliente'); } $servicio = Servicio::find($id); $tipo = TipoServicio::lists('nombre', 'id')->all(); $cliente_id = $servicio->cliente_id; $cliente = User::find($cliente_id); $tecnico = User::where('nivel', 'tecnico')->lists('email', 'id'); return view('servicios.edit')->with('servicio', $servicio)->with('cliente', $cliente)->with('tecnico', $tecnico)->with('tipo', $tipo); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $obj = Servicio::findOrFail($id); $tipos = TipoServicio::lists('nombre', 'id'); return view('servicios.edit', array('obj' => $obj, 'tipos' => $tipos)); }