Ejemplo n.º 1
0
 /**
  * Display the specified resource.
  * GET /usuarios/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function getEdit($id = NULL)
 {
     if (isset($id)) {
         $usuario = Usuario::find($id);
         $perfiles = Perfil::all()->lists('nombre', 'id');
         $hoteles = Hotel::all()->lists('nombre', 'id');
         $personas = Persona::all()->lists('nombre', 'id');
         return View::make('usuarios.edit', compact('perfiles', 'hoteles', 'personas', 'usuario'));
     } else {
         return Redirect::to('/usuarios');
     }
 }
Ejemplo n.º 2
0
 /**
  * Display a listing of the resource.
  * GET /persona
  *
  * @return Response
  */
 public function getIndex()
 {
     $personas = Persona::all();
     return View::make('persona.index', compact('personas'));
 }
Ejemplo n.º 3
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $personas = Persona::all();
     return json_encode($personas);
 }