src/FieldBuilder.php
protected function getClasses($type, array $attributes = [], $errors = null)
    {
        $classes = $this->getDefaultClasses($type);

        if (isset($attributes['class'])) {
            $classes .= ' '.$attributes['class'];
        }

        if ( ! empty($errors)) {
            $classes .= ' '.(isset($this->cssClasses['error']) ? $this->cssClasses['error'] : 'error');
        }

        return trim($classes);
    }
protected function getClasses($type, array $attributes = [], $errors = null)
    {
        $classes = $this->getDefaultClasses($type);

        if (isset($attributes['class'])) {
            $classes .= ' '.$attributes['class'];
        }

        if ( ! empty($errors)) {
            $classes .= ' '.(isset($this->cssClasses['error']) ? $this->cssClasses['error'] : 'error');
        }

        return trim($classes);
    }
protected function getClasses ( $ type , array $ attributes = [ ] , $ errors = null ) { $ classes = $ this -> getDefaultClasses ( $ type ) ; if ( isset ( $ attributes [ 'class' ] ) ) { $ classes .= ' ' . $ attributes [ 'class' ] ; } if ( ! empty ( $ errors ) ) { $ classes .= ' ' . ( isset ( $ this -> cssClasses [ 'error' ] ) ? $ this -> cssClasses [ 'error' ] : 'error' ) ; } return trim ( $ classes ) ; }
Get the HTML classes for a particular field.

It concatenates the default CSS classes plus the custom classes (passed
as the class key in the $attributes array).

And it will also add an extra class if the control has any errors.

@param  string $type
@param  array $attributes
@param  string|null $errors
@return string
Get the HTML classes for a particular field .