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); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(CreateTipoServicioRequest $request, $id) { $input = $request->all(); $obj = TipoServicio::findOrFail($id); $obj->nombre = $input['nombre']; $obj->save(); Session::flash('mensaje', 'Tipo de servicio actualizado'); Session::flash('alert-class', 'alert-success'); return redirect(route('tipo_servicios')); }
public function serviciosTipo() { $tipos = TipoServicio::all(); return view('descargas.serviciosTipo')->with('tipos', $tipos); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $tipoServicios = TipoServicio::all(); $servicios = Servicio::all(); return view('reservas.create', array('tipoServicios' => $tipoServicios, 'servicios' => $servicios)); }
/** * 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)); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { TipoServicio::find($id)->delete(); Flash::warning('Se ha eliminado el tipo de servicio exitosamente!'); return redirect()->route('servicios.tipos.index'); }