public function edit($id)
    {
        $record = $this->modelRepository->findOrFail($id);

        $fields = array_only(
            $this->modelInformation->form->fields,
            $this->getRelevantFormFieldKeys()
        );

        $this->checkListParents(false);

        $values = $this->getFormFieldValuesFromModel($record, array_keys($fields));
        $errors = $this->getNormalizedFormFieldErrors();

        $renderedFields = $this->renderedFormFieldStrategies($record, $fields, $values, $errors);

        return view($this->getEditView(), [
            'moduleKey'           => $this->moduleKey,
            'routePrefix'         => $this->routePrefix,
            'permissionPrefix'    => $this->permissionPrefix,
            'model'               => $this->modelInformation,
            'record'              => $record,
            'recordReference'     => $this->getReferenceRepository()->getReferenceForModel($record),
            'creating'            => false,
            'fields'              => $fields,
            'fieldStrategies'     => $renderedFields,
            'values'              => $values,
            'fieldErrors'         => $errors,
            'activeTab'           => $this->getActiveTab(),
            'errorsPerTab'        => $this->getErrorCountsPerTabPane(),
            'hasActiveListParent' => (bool) $this->listParentRelation,
            'topListParentOnly'   => $this->showsTopParentsOnly(),
            'listParents'         => $this->listParents,
        ]);
    }
public function edit($id)
    {
        $record = $this->modelRepository->findOrFail($id);

        $fields = array_only(
            $this->modelInformation->form->fields,
            $this->getRelevantFormFieldKeys()
        );

        $this->checkListParents(false);

        $values = $this->getFormFieldValuesFromModel($record, array_keys($fields));
        $errors = $this->getNormalizedFormFieldErrors();

        $renderedFields = $this->renderedFormFieldStrategies($record, $fields, $values, $errors);

        return view($this->getEditView(), [
            'moduleKey'           => $this->moduleKey,
            'routePrefix'         => $this->routePrefix,
            'permissionPrefix'    => $this->permissionPrefix,
            'model'               => $this->modelInformation,
            'record'              => $record,
            'recordReference'     => $this->getReferenceRepository()->getReferenceForModel($record),
            'creating'            => false,
            'fields'              => $fields,
            'fieldStrategies'     => $renderedFields,
            'values'              => $values,
            'fieldErrors'         => $errors,
            'activeTab'           => $this->getActiveTab(),
            'errorsPerTab'        => $this->getErrorCountsPerTabPane(),
            'hasActiveListParent' => (bool) $this->listParentRelation,
            'topListParentOnly'   => $this->showsTopParentsOnly(),
            'listParents'         => $this->listParents,
        ]);
    }
public function edit ( $ id ) { $ record = $ this -> modelRepository -> findOrFail ( $ id ) ; $ fields = array_only ( $ this -> modelInformation -> form -> fields , $ this -> getRelevantFormFieldKeys ( ) ) ; $ this -> checkListParents ( false ) ; $ values = $ this -> getFormFieldValuesFromModel ( $ record , array_keys ( $ fields ) ) ; $ errors = $ this -> getNormalizedFormFieldErrors ( ) ; $ renderedFields = $ this -> renderedFormFieldStrategies ( $ record , $ fields , $ values , $ errors ) ; return view ( $ this -> getEditView ( ) , [ 'moduleKey' => $ this -> moduleKey , 'routePrefix' => $ this -> routePrefix , 'permissionPrefix' => $ this -> permissionPrefix , 'model' => $ this -> modelInformation , 'record' => $ record , 'recordReference' => $ this -> getReferenceRepository ( ) -> getReferenceForModel ( $ record ) , 'creating' => false , 'fields' => $ fields , 'fieldStrategies' => $ renderedFields , 'values' => $ values , 'fieldErrors' => $ errors , 'activeTab' => $ this -> getActiveTab ( ) , 'errorsPerTab' => $ this -> getErrorCountsPerTabPane ( ) , 'hasActiveListParent' => ( bool ) $ this -> listParentRelation , 'topListParentOnly' => $ this -> showsTopParentsOnly ( ) , 'listParents' => $ this -> listParents , ] ) ; }
Displays form to edit an existing record.

@param mixed $id
@return mixed
Displays form to edit an existing record .