/** * 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'); } }
/** * Display a listing of the resource. * GET /persona * * @return Response */ public function getIndex() { $personas = Persona::all(); return View::make('persona.index', compact('personas')); }
/** * Store a newly created resource in storage. * * @return Response */ public function store() { $personas = Persona::all(); return json_encode($personas); }