src/Services/FormMaker.php
private function formBuilder($view, $errors, $field, $column, $input)
    {
        $formGroupClass = config('form-maker.form.group-class', 'form-group');
        $formErrorClass = config('form-maker.form.error-class', 'has-error');

        $errorHighlight = '';
        $errorMessage = false;

        if (!empty($errors) && $errors->has($column)) {
            $errorHighlight = ' '.$formErrorClass;
            $errorMessage = $errors->get($column);
        }

        if (is_null($view)) {
            $formBuild = '<div class="'.$formGroupClass.' '.$errorHighlight.'">';
            $formBuild .= $this->formContentBuild($field, $column, $input, $errorMessage);
            $formBuild .= '</div>';
        } else {
            $formBuild = View::make($view, [
                'labelFor' => ucfirst($column),
                'label' => $this->columnLabel($field, $column),
                'input' => $input,
                'field' => $field,
                'errorMessage' => $this->errorMessage($errorMessage),
                'errorHighlight' => $errorHighlight,
            ]);
        }

        return $formBuild;
    }
private function formBuilder($view, $errors, $field, $column, $input)
    {
        $formGroupClass = config('form-maker.form.group-class', 'form-group');
        $formErrorClass = config('form-maker.form.error-class', 'has-error');

        $errorHighlight = '';
        $errorMessage = false;

        if (!empty($errors) && $errors->has($column)) {
            $errorHighlight = ' '.$formErrorClass;
            $errorMessage = $errors->get($column);
        }

        if (is_null($view)) {
            $formBuild = '<div class="'.$formGroupClass.' '.$errorHighlight.'">';
            $formBuild .= $this->formContentBuild($field, $column, $input, $errorMessage);
            $formBuild .= '</div>';
        } else {
            $formBuild = View::make($view, [
                'labelFor' => ucfirst($column),
                'label' => $this->columnLabel($field, $column),
                'input' => $input,
                'field' => $field,
                'errorMessage' => $this->errorMessage($errorMessage),
                'errorHighlight' => $errorHighlight,
            ]);
        }

        return $formBuild;
    }
private function formBuilder ( $ view , $ errors , $ field , $ column , $ input ) { $ formGroupClass = config ( 'form-maker.form.group-class' , 'form-group' ) ; $ formErrorClass = config ( 'form-maker.form.error-class' , 'has-error' ) ; $ errorHighlight = '' ; $ errorMessage = false ; if ( ! empty ( $ errors ) && $ errors -> has ( $ column ) ) { $ errorHighlight = ' ' . $ formErrorClass ; $ errorMessage = $ errors -> get ( $ column ) ; } if ( is_null ( $ view ) ) { $ formBuild = '<div class="' . $ formGroupClass . ' ' . $ errorHighlight . '">' ; $ formBuild .= $ this -> formContentBuild ( $ field , $ column , $ input , $ errorMessage ) ; $ formBuild .= '</div>' ; } else { $ formBuild = View :: make ( $ view , [ 'labelFor' => ucfirst ( $ column ) , 'label' => $ this -> columnLabel ( $ field , $ column ) , 'input' => $ input , 'field' => $ field , 'errorMessage' => $ this -> errorMessage ( $ errorMessage ) , 'errorHighlight' => $ errorHighlight , ] ) ; } return $ formBuild ; }
Constructs HTML forms.

@param string       $view   View template
@param array|object $errors
@param array        $field  Array of field values
@param string       $column Column name
@param string       $input  Input string

@return string
Constructs HTML forms .