Show the form for editing the specified resource.

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

@param $id

@return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
779812
public function edit($id)
    {
        try
        {
            $group = $this->groups->findById($id);

            $groupPermissions = $group->getPermissions();
            $genericPermissions = $this->permissions->generic();
            $modulePermissions = $this->permissions->module();


            return View::make(Config::get('cpanel::views.groups_edit'))
                ->with('group',$group)
                ->with('genericPermissions',$genericPermissions)
                ->with('modulePermissions',$modulePermissions)
                ->with('groupPermissions',$groupPermissions);
        }
        catch ( GroupNotFoundException $e)
        {
            return Redirect::route('admin.groups.index')->with('error', $e->getMessage());
        }
    }
417709
public function editAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();
        $template = $em->getRepository('OpiferContentBundle:Template')->find($id);

        $form = $this->createForm(TemplateType::class, $template);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em->flush();

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

        return $this->render('OpiferCmsBundle:Backend/Template:edit.html.twig', [
            'form' => $form->createView(),
            'template' => $template,
        ]);
    }
975490
public function editAction($id)
    {
        $profile = Profiles::findFirstById($id);
        if (!$profile) {
            $this->flash->error("Profile was not found");
            return $this->dispatcher->forward([
                'action' => 'index'
            ]);
        }

        if ($this->request->isPost()) {

            $profile->assign([
                'name' => $this->request->getPost('name', 'striptags'),
                'active' => $this->request->getPost('active')
            ]);

            if (!$profile->save()) {
                $this->flash->error($profile->getMessages());
            } else {
                $this->flash->success("Profile was updated successfully");
            }

            Tag::resetInput();
        }

        $this->view->form = new ProfilesForm($profile, [
            'edit' => true
        ]);

        $this->view->profile = $profile;
    }
95967
public function edit($id) {
		$dep        = Dep::find($id);
		$department = Dep::where('parent', null)->pluck('name_'.app('l'), 'id');
		return view('admin.department.edit', ['title' => trans('admin.edit'),
				'department'                                => $department,
				'edit'                                      => $dep,
			]);
	}
225439
public function getEdit($id = '')
    {

        $form = FormBuilder::create(get_class($this->form));


        $form_content = view('form-builder::form.components.formgenerator.full', [
            'form' => $form
        ]);
        $content      = view('expendable::admin.form.state.form', [

        ]);

        $this->layoutManager->add([
            'form'    => $form_content,
            'content' => $content,
        ]);

        return $this->layoutManager->render();
    }
902798
public function actionView($id)
    {
        $model = $this->findModel($id);
        $viewPostUrl = $this->getViewPostUrl($model);

        return $this->render('view', [
            'model' => $model,
            'viewPostUrl' => $viewPostUrl,
        ]);
    }
999860
public function edit($id)
    {
        $notification = $this->service->find($id);
        return view('admin.notifications.edit')->with('notification', $notification);
    }
288188
public function edit($id)
    {
        $entry = $this->entriesRepository->getById($id, $this->resource);

        return view('laramanager::entries.edit')
            ->with('resource', $this->resource)
            ->with('entry', $entry);
    }
164523
public function edit($id)
    {
        $permission = $this->permissions->find($id);

        if ( $permission )
        {
            return View::make( Config::get('cpanel::views.permissions_edit') )
                ->with('permission', $permission);
        }
        else
        {
            return Redirect::route('cpanel.permissions.index')
                ->with('error', Lang::get('cpanel::permissions.model_not_found'));
        }
    }
1138313
public function getEdit($id = null)
    {
        $group = Sentinel::getRoleRepository()->find($id);

        // Get the group's information
        if($group == null)
        {
            // Prepare the error message
            $error = Lang::get('base.groups.not_found');

            // Redirect to the post management page
            return Redirect::route('groups')->with('error', $error);
        }

        $groups = null;

        $groups2 = Sentinel::getRoleRepository()->all(['id', 'name']);

        foreach ($groups2 as $g)
            $groups[$g->id] = $g->name;

        // Show the page
        return View('admin.groups.edit', compact('group', 'groups'));
    }
690821
public function edit($id)
    {
        $role = $this->service->find($id);
        return view('admin.roles.edit')->with('role', $role);
    }
283307
public function editAction($id = null)
    {
        $request = $this->getRequest();
        // the key used to lookup the template
        $templateKey = 'edit';

        $id = $request->get($this->admin->getIdParameter());
        $existingObject = $this->admin->getObject($id);

        if (!$existingObject) {
            throw $this->createNotFoundException(sprintf('unable to find the object with id: %s', $id));
        }

        $this->checkParentChildAssociation($request, $existingObject);

        $this->admin->checkAccess('edit', $existingObject);

        $preResponse = $this->preEdit($request, $existingObject);
        if (null !== $preResponse) {
            return $preResponse;
        }

        $this->admin->setSubject($existingObject);
        $objectId = $this->admin->getNormalizedIdentifier($existingObject);

        $form = $this->admin->getForm();

        if (!\is_array($fields = $form->all()) || 0 === \count($fields)) {
            throw new \RuntimeException(
                'No editable field defined. Did you forget to implement the "configureFormFields" method?'
            );
        }

        $form->setData($existingObject);
        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $isFormValid = $form->isValid();

            // persist if the form was valid and if in preview mode the preview was approved
            if ($isFormValid && (!$this->isInPreviewMode() || $this->isPreviewApproved())) {
                $submittedObject = $form->getData();
                $this->admin->setSubject($submittedObject);

                try {
                    $existingObject = $this->admin->update($submittedObject);

                    if ($this->isXmlHttpRequest()) {
                        return $this->renderJson([
                            'result' => 'ok',
                            'objectId' => $objectId,
                            'objectName' => $this->escapeHtml($this->admin->toString($existingObject)),
                        ], 200, []);
                    }

                    $this->addFlash(
                        'sonata_flash_success',
                        $this->trans(
                            'flash_edit_success',
                            ['%name%' => $this->escapeHtml($this->admin->toString($existingObject))],
                            'SonataAdminBundle'
                        )
                    );

                    // redirect to edit mode
                    return $this->redirectTo($existingObject);
                } catch (ModelManagerException $e) {
                    $this->handleModelManagerException($e);

                    $isFormValid = false;
                } catch (LockException $e) {
                    $this->addFlash('sonata_flash_error', $this->trans('flash_lock_error', [
                        '%name%' => $this->escapeHtml($this->admin->toString($existingObject)),
                        '%link_start%' => '<a href="'.$this->admin->generateObjectUrl('edit', $existingObject).'">',
                        '%link_end%' => '</a>',
                    ], 'SonataAdminBundle'));
                }
            }

            // show an error message if the form failed validation
            if (!$isFormValid) {
                if (!$this->isXmlHttpRequest()) {
                    $this->addFlash(
                        'sonata_flash_error',
                        $this->trans(
                            'flash_edit_error',
                            ['%name%' => $this->escapeHtml($this->admin->toString($existingObject))],
                            'SonataAdminBundle'
                        )
                    );
                }
            } elseif ($this->isPreviewRequested()) {
                // enable the preview template if the form was valid and preview was requested
                $templateKey = 'preview';
                $this->admin->getShow();
            }
        }

        $formView = $form->createView();
        // set the theme for the current Admin Form
        $this->setFormTheme($formView, $this->admin->getFormTheme());

        // NEXT_MAJOR: Remove this line and use commented line below it instead
        $template = $this->admin->getTemplate($templateKey);
        // $template = $this->templateRegistry->getTemplate($templateKey);

        return $this->renderWithExtraParams($template, [
            'action' => 'edit',
            'form' => $formView,
            'object' => $existingObject,
            'objectId' => $objectId,
        ], null);
    }
331236
public function editAction( $id = null ) {
		$request = $this->getRequest();

		$pageId      = $request->get( 'pageId' );
		$formFieldId = $request->get( 'formFieldId' );
		$uniqId      = $request->get( 'uniqId' );
		$code        = $request->get( 'code', 'networking_init_cms.admin.page' );


		$layoutBlock = $this->admin->getObject( $id );

		/** @var $form \Symfony\Component\Form\Form */
		$form = $this->admin->getForm();
		$form->setData( $layoutBlock );

		$form->handleRequest( $request );
		$response = null;

		if ( $form->isSubmitted() ) {
			if ( $form->isValid() ) {
				$this->admin->update( $layoutBlock );
				$html   = $this->getLayoutBlockFormWidget( $pageId, $formFieldId, $uniqId, $code );
				$status = 200;

				return new Response( $html, $status );
			} else {
				$this->error = true;

				$response = new Response();
				$response->setStatusCode( 500 );
			}

		}

		$view = $form->createView();

		// set the theme for the current Admin Form
		$this->get( 'twig' )->getRuntime( FormRenderer::class )->setTheme( $view, $this->admin->getFormTheme() );

		return $this->renderWithExtraParams(
			'@NetworkingInitCms/PageAdmin/layout_block_edit.html.twig',
			[
				'action' => 'create',
				'form'   => $view,
				'object' => $layoutBlock,
			],
			$response
		);
	}
736334
public function edit($id): Content
    {
        return Admin::content(function (Content $content) use ($id) {
            $content->header($this->title());

            $content->body($this->form($id)->edit($id));
        });
    }
1084851
public function edit($id)
    {
        $model = $this->model->findOrFail($id);
        $categories = new Category;
        $tags = new Tag;
        return view('LaravelAdminBlog::.edit')
            ->with('categories', $categories->forSelect())
            ->with('tags', $tags->forSelect())
            ->with('article', $model)
            ->with('activeMenu', 'sidebar.Blog.List');
    }
1290404
public function edit($id = null) {
		$country = $this->Countries->get($id);

		if ($this->Common->isPosted()) {
			$country = $this->Countries->patchEntity($country, $this->request->getData());
			if ($this->Countries->save($country)) {
				$name = $country['name'];
				$this->Flash->success(__('record edit {0} saved', h($name)));
				return $this->redirect(['action' => 'index']);
			}

			$this->Flash->error(__('record edit not saved'));
		}

		$this->set(compact('country'));
	}
878524
public function edit($id = null) {
        $cmsContent = $this->CmsContent->get($id, [
            'contain' => []
        ]);
        if ($this->request->is(['patch', 'post', 'put'])) {
            $cmsContent = $this->CmsContent->patchEntity($cmsContent, $this->request->data);
            if ($this->CmsContent->save($cmsContent)) {
                $this->Flash->success('The cms content has been saved.');
                return $this->redirect(['action' => 'index']);
            } else {
                $this->Flash->error('The cms content could not be saved. Please, try again.');
            }
        }
        $this->set(compact('cmsContent'));
        $this->set('_serialize', ['cmsContent']);
    }