Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 /**
  * 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'));
 }
Ejemplo n.º 3
0
 public function serviciosTipo()
 {
     $tipos = TipoServicio::all();
     return view('descargas.serviciosTipo')->with('tipos', $tipos);
 }
Ejemplo n.º 4
0
 /**
  * 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));
 }
Ejemplo n.º 5
0
 /**
  * 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);
 }
Ejemplo n.º 6
0
 /**
  * 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');
 }