src/Services/FormMaker.php
public function fromArray(
        $array,
        $columns = null,
        $view = null,
        $class = null,
        $populated = true,
        $reformatted = false,
        $timestamps = false
    ) {
        $formBuild = [];

        if (is_null($class)) {
            $class = config('form-maker.forms.form-class', 'form-control');
        }

        $array = $this->cleanupIdAndTimeStamps($array, $timestamps, false);
        $errors = $this->getFormErrors();

        if (is_null($columns)) {
            $columns = $array;
        }

        foreach ($columns as $column => $columnConfig) {
            if (is_numeric($column)) {
                $column = $columnConfig;
            }
            if ($column === 'id') {
                $columnConfig = ['type' => 'hidden'];
            }

            $input = $this->inputMaker->create($column, $columnConfig, $array, $class, $reformatted, $populated);
            $formBuild[] = $this->formBuilder($view, $errors, $columnConfig, $column, $input);
        }

        return $this->buildUsingColumns($formBuild, config('form-maker.form.theme'));
    }
public function fromArray(
        $array,
        $columns = null,
        $view = null,
        $class = null,
        $populated = true,
        $reformatted = false,
        $timestamps = false
    ) {
        $formBuild = [];

        if (is_null($class)) {
            $class = config('form-maker.forms.form-class', 'form-control');
        }

        $array = $this->cleanupIdAndTimeStamps($array, $timestamps, false);
        $errors = $this->getFormErrors();

        if (is_null($columns)) {
            $columns = $array;
        }

        foreach ($columns as $column => $columnConfig) {
            if (is_numeric($column)) {
                $column = $columnConfig;
            }
            if ($column === 'id') {
                $columnConfig = ['type' => 'hidden'];
            }

            $input = $this->inputMaker->create($column, $columnConfig, $array, $class, $reformatted, $populated);
            $formBuild[] = $this->formBuilder($view, $errors, $columnConfig, $column, $input);
        }

        return $this->buildUsingColumns($formBuild, config('form-maker.form.theme'));
    }
public function fromArray ( $ array , $ columns = null , $ view = null , $ class = null , $ populated = true , $ reformatted = false , $ timestamps = false ) { $ formBuild = [ ] ; if ( is_null ( $ class ) ) { $ class = config ( 'form-maker.forms.form-class' , 'form-control' ) ; } $ array = $ this -> cleanupIdAndTimeStamps ( $ array , $ timestamps , false ) ; $ errors = $ this -> getFormErrors ( ) ; if ( is_null ( $ columns ) ) { $ columns = $ array ; } foreach ( $ columns as $ column => $ columnConfig ) { if ( is_numeric ( $ column ) ) { $ column = $ columnConfig ; } if ( $ column === 'id' ) { $ columnConfig = [ 'type' => 'hidden' ] ; } $ input = $ this -> inputMaker -> create ( $ column , $ columnConfig , $ array , $ class , $ reformatted , $ populated ) ; $ formBuild [ ] = $ this -> formBuilder ( $ view , $ errors , $ columnConfig , $ column , $ input ) ; } return $ this -> buildUsingColumns ( $ formBuild , config ( 'form-maker.form.theme' ) ) ; }
Build the form from an array.

@param array  $array
@param array  $columns
@param string $view        A template to use for the rows
@param string $class       Default input class
@param bool   $populated   Is content populated
@param bool   $reformatted Are column names reformatted
@param bool   $timestamps  Are the timestamps available?

@return string
Build the form from an array .