protected function setupNamedModel()
    {
        if (!$this->getModel() || !$this->getName()) {
            return false;
        }

        $dotName = $this->formHelper->transformToDotSyntax($this->getName());
        $model = $this->formHelper->convertModelToArray($this->getModel());
        $isCollectionFormModel = (bool) preg_match('/^.*\.\d+$/', $dotName);
        $isCollectionPrototype = strpos($dotName, '__NAME__') !== false;

        if (!Arr::get($model, $dotName) && !$isCollectionFormModel && !$isCollectionPrototype) {
            $newModel = [];
            Arr::set($newModel, $dotName, $model);
            $this->model = $newModel;

            return true;
        }

        return false;
    }
protected function setupNamedModel()
    {
        if (!$this->getModel() || !$this->getName()) {
            return false;
        }

        $dotName = $this->formHelper->transformToDotSyntax($this->getName());
        $model = $this->formHelper->convertModelToArray($this->getModel());
        $isCollectionFormModel = (bool) preg_match('/^.*\.\d+$/', $dotName);
        $isCollectionPrototype = strpos($dotName, '__NAME__') !== false;

        if (!Arr::get($model, $dotName) && !$isCollectionFormModel && !$isCollectionPrototype) {
            $newModel = [];
            Arr::set($newModel, $dotName, $model);
            $this->model = $newModel;

            return true;
        }

        return false;
    }
protected function setupNamedModel ( ) { if ( ! $ this -> getModel ( ) || ! $ this -> getName ( ) ) { return false ; } $ dotName = $ this -> formHelper -> transformToDotSyntax ( $ this -> getName ( ) ) ; $ model = $ this -> formHelper -> convertModelToArray ( $ this -> getModel ( ) ) ; $ isCollectionFormModel = ( bool ) preg_match ( '/^.*\.\d+$/' , $ dotName ) ; $ isCollectionPrototype = strpos ( $ dotName , '__NAME__' ) !== false ; if ( ! Arr :: get ( $ model , $ dotName ) && ! $ isCollectionFormModel && ! $ isCollectionPrototype ) { $ newModel = [ ] ; Arr :: set ( $ newModel , $ dotName , $ model ) ; $ this -> model = $ newModel ; return true ; } return false ; }
Set namespace to model if form is named so the data is bound properly.
Returns true if model is changed, otherwise false.

@return bool
Set namespace to model if form is named so the data is bound properly . Returns true if model is changed otherwise false .