public function formatAttribute($attributes = [])
    {
        $attributes = $attributes ?: $this->attributes;

        if ($this->hasFile()) {
            $attributes['enctype'] = 'multipart/form-data';
        }

        $html = [];
        foreach ($attributes as $key => $val) {
            $html[] = "$key=\"$val\"";
        }

        return implode(' ', $html) ?: '';
    }
public function formatAttribute($attributes = [])
    {
        $attributes = $attributes ?: $this->attributes;

        if ($this->hasFile()) {
            $attributes['enctype'] = 'multipart/form-data';
        }

        $html = [];
        foreach ($attributes as $key => $val) {
            $html[] = "$key=\"$val\"";
        }

        return implode(' ', $html) ?: '';
    }
public function formatAttribute ( $ attributes = [ ] ) { $ attributes = $ attributes ? : $ this -> attributes ; if ( $ this -> hasFile ( ) ) { $ attributes [ 'enctype' ] = 'multipart/form-data' ; } $ html = [ ] ; foreach ( $ attributes as $ key => $ val ) { $ html [ ] = "$key=\"$val\"" ; } return implode ( ' ' , $ html ) ? : '' ; }
Format form attributes form array to html.

@param array $attributes

@return string
Format form attributes form array to html .