Process the edit form

@author Steve Montambeault
@link   http://stevemo.ca

@param $id

@return \Illuminate\Http\RedirectResponse
548427
public function update($id)
    {
        $inputs = Input::all();
        $inputs['id'] = $id;

        try
        {
            if ( $this->form->update($inputs) )
            {
                return Redirect::route('cpanel.permissions.index')
                    ->with('success', Lang::get('cpanel::permissions.update_success'));
            }

            return Redirect::back()
                ->withInput()
                ->withErrors($this->form->getErrors());
        }
        catch ( PermissionNotFoundException $e )
        {
            return Redirect::route('cpanel.permissions.index')
                ->with('error', Lang::get('cpanel::permissions.model_not_found'));
        }
    }
932655
public function edit($id = null)
    {
        $cmsTerm = $this->CmsTerm->get($id, [
            'contain' => []
        ]);
        if ($this->request->is(['patch', 'post', 'put'])) {
            $cmsTerm = $this->CmsTerm->patchEntity($cmsTerm, $this->request->data);
            if ($this->CmsTerm->save($cmsTerm)) {
                $this->Flash->success('The cms term has been saved.');
                return $this->redirect(['action' => 'index']);
            } else {
                $this->Flash->error('The cms term could not be saved. Please, try again.');
            }
        }
        $this->set(compact('cmsTerm'));
        $this->set('_serialize', ['cmsTerm']);
    }
415540
public function edit($id = null)
    {
        $photo = $this->Photos->get($id);

        if ($this->request->is(['patch', 'post', 'put'])) {
            $photo = $this->Photos->patchEntity($photo, $this->request->getData());

            if ($this->Photos->save($photo)) {
                $this->Flash->success(I18N_OPERATION_OK);

                return $this->redirect(['action' => 'index', $photo->album_id]);
            }

            $this->Flash->error(I18N_OPERATION_NOT_OK);
        }

        $this->set(compact('photo'));
    }
1321754
public function edit($id = null)
    {
        $tag = $this->PostsTags->Tags->get($id);

        if ($this->request->is(['patch', 'post', 'put'])) {
            $tag = $this->PostsTags->Tags->patchEntity($tag, $this->request->getData());

            if ($this->PostsTags->Tags->save($tag)) {
                $this->Flash->success(I18N_OPERATION_OK);

                return $this->redirect(['action' => 'index']);
            }

            $this->Flash->error(I18N_OPERATION_NOT_OK);
        }

        $this->set(compact('tag'));
    }
258532
public function edit($id)
    {
        try {
            $role = $this->repository->findById($id);

            $permission_role = $role->permissions->lists('id');

            return $this->view('roles.edit', compact('role', 'permission_role'));
        } catch (ModelNotFoundException $e) {
            return $this->redirectNotFound();
        }
    }
1240335
public function edit($id)
    {
        $blog = $this->repository->find($id);

        if (empty($blog)) {
            Cms::notification('Blog not found', 'warning');

            return redirect(route($this->routeBase.'.blog.index'));
        }

        return view('cms::modules.blogs.edit')->with('blog', $blog);
    }
114780
public function getEdit($id) {
    $term = Term::find($id);

    if (is_null($term)) {
      return Redirect::back($this->route_prefix . 'taxonomy.index');
    }

     return View::make('taxonomy::terms.edit', compact('term'));
  }
836115
public function edit($id)
    {
        try
        {
            $user = $this->users->findById($id);
            $groups = $this->groups->findAll();

            $userPermissions = $user->getPermissions();
            $genericPermissions = $this->permissions->generic();
            $modulePermissions = $this->permissions->module();

            //get only the group id the user belong to
            $userGroupsId = array_pluck($user->getGroups()->toArray(), 'id');

            return View::make(Config::get('cpanel::views.users_edit'))
                ->with('user',$user)
                ->with('groups',$groups)
                ->with('userGroupsId',$userGroupsId)
                ->with('genericPermissions',$genericPermissions)
                ->with('modulePermissions',$modulePermissions)
                ->with('userPermissions',$userPermissions);
        }
        catch (UserNotFoundException $e)
        {
            return Redirect::route('cpanel.users.index')
                ->with('error',$e->getMessage());
        }
    }
1122753
public function createEditForm($id) {
        $entity = $this->read_handler->get($id);
        $edit_form = $this->form_factory->create(new Type(), $entity);

        return $edit_form;
    }
1023142
public function actionDelete($id)
    {
        $this->findModel($id)->updateAttributes(['status' => User::STATUS_DELETED]);

        return $this->redirect(['index']);
    }
162366
public function edit($id)
    {
        $permission = $this->permissions->findById($id);
        $roleIds = $this->permissions->getRoles();

        if (! $permission) {
            return $this->handleError(trans('soda::errors.not-found', ['object' => 'permission']));
        }

        app('soda.interface')->setHeading($permission->display_name);
        app('soda.interface')->breadcrumbs()->addLink(route('soda.permissions.index'), 'Permissions');

        return soda_cms_view('data.permissions.view', compact('permission', 'roleIds'));
    }
92135
public function edit($id = null)
    {
        $position = $this->BannersPositions->get($id);

        if ($this->request->is(['patch', 'post', 'put'])) {
            $position = $this->BannersPositions->patchEntity($position, $this->request->getData());

            if ($this->BannersPositions->save($position)) {
                $this->Flash->success(I18N_OPERATION_OK);

                return $this->redirect(['action' => 'index']);
            }

            $this->Flash->error(I18N_OPERATION_NOT_OK);
        }

        $this->set(compact('position'));
    }
77903
public function editAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();
        $site = $em->getRepository(Site::class)->find($id);

        $originalDomains = new ArrayCollection();
        foreach ($site->getDomains() as $domain) {
            $originalDomains->add($domain);
        }

        $form = $this->createForm(SiteType::class, $site);
        $form->handleRequest($request);


        if ($form->isSubmitted() && $form->isValid()) {

            // Remove deleted domains
            foreach ($originalDomains as $domain) {
                if (false === $site->getDomains()->contains($domain)) {
                    $em->remove($domain);
                }
            }

            // Add new domain
            foreach ($form->getData()->getDomains() as $domain) {
                $domain->setSite($site);
            }
            $em->persist($domain);

            $em->flush();

            return $this->redirectToRoute('opifer_cms_site_edit', ['id' => $site->getId()]);
        }

        return $this->render('OpiferCmsBundle:Backend/Site:edit.html.twig', [
            'form' => $form->createView(),
            'site' => $site,
        ]);
    }
849445
public function edit($id)
    {
        $tag = $this->model->findOrFail($id);

        return view('LaravelAdminBlog::tags.edit')
            ->with('tag', $tag)
            ->with('activeMenu', 'sidebar.Blog.Tags');
    }
753304
public function edit($id)
	{
        $category = $this->model->findOrFail($id);
        return view('LaravelAdminBlog::categories.edit')
            ->with('category', $category)
            ->with('activeMenu', 'sidebar.Blog.Categories');
	}
908835
public function edit($id = null)
    {
        $role = $this->Roles->get($id, [
            'contain' => []
        ]);

        if ($this->request->is(['patch', 'post', 'put'])) {
            $role = $this->Roles->patchEntity($role, $this->request->data);
            if ($this->Roles->save($role)) {
                $this->Flash->success(__('The role has been saved.'));
                return $this->redirect(['action' => 'index']);
            } else {
                $this->Flash->error(__('The role could not be saved. Please, try again.'));
            }
        }

        $this->set(compact('role'));

        $this->render(Configure::read('CM.AdminRoleViews.edit'));
    }
511636
public function edit($id)
    {
        if (\Auth::user()->id == 1 || \Auth::user()->id == 2) {
            $user = Admin::find($id);
            return view('adminems::users.edit', compact('user'));
        }

        return redirect()->route('panel');
    }