/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { //Asignar roles a usuario $user = User::whereId($id)->firstOrFail(); $roles = Role::all(); $sedes = Sede::all(); $selectedRoles = $user->roles->lists('id')->toArray(); $selectedSedes = $user->sedes->lists('id')->toArray(); return view('backend.users.edit', compact('user', 'roles', 'sedes', 'selectedRoles', 'selectedSedes')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { //Muestra todas las sedes $sedes = Sede::all(); return view('backend.sedes.index', compact('sedes')); }