/** * @param $id * @return mixed */ public function edit($id, Request $request) { $view = View::make('includes.partials.medialist_grid'); $user = $this->users->findOrThrowException($id, true); if ($request->ajax()) { $sections = $view->renderSections(); return json_encode($sections['mediagrid']); //return Response::json(view('', compact('posts'))->render()); } else { return view('backend.access.edit')->withUser($user)->withRoles($this->roles->getAllRoles('id', 'asc', true))->withUserPermissions($user->permissions->lists('id')->all())->withPermissions($this->permissions->getPermissionsNotAssociatedWithRole())->withOrganizations($this->organizations->getAllOrganizations('name', 'asc')); } }
/** * @param $id * @return mixed */ public function edit($id) { $user = $this->users->findOrThrowException($id, true); return view('backend.access.edit')->withUser($user)->withUserRoles($user->roles->lists('id')->all())->withRoles($this->roles->getAllRoles('id', 'asc', true))->withUserPermissions($user->permissions->lists('id')->all())->withPermissions($this->permissions->getPermissionsNotAssociatedWithRole()); }