src/Form.php
public function error($name, $template = null)
    {
        $errors = $this->session->get('errors');
        // Default template is bootstrap friendly.
        if (is_null($template)) {
            $template = config('form-helpers.error_template');
        }
        if ($errors && $errors->has($name)) {
            return str_replace(':message', e($errors->first($name)), $template);
        }
    }
public function error($name, $template = null)
    {
        $errors = $this->session->get('errors');
        // Default template is bootstrap friendly.
        if (is_null($template)) {
            $template = config('form-helpers.error_template');
        }
        if ($errors && $errors->has($name)) {
            return str_replace(':message', e($errors->first($name)), $template);
        }
    }
public function error ( $ name , $ template = null ) { $ errors = $ this -> session -> get ( 'errors' ) ; // Default template is bootstrap friendly. if ( is_null ( $ template ) ) { $ template = config ( 'form-helpers.error_template' ) ; } if ( $ errors && $ errors -> has ( $ name ) ) { return str_replace ( ':message' , e ( $ errors -> first ( $ name ) ) , $ template ) ; } }
Get the error message if exists.

@param  string $name
@param  string|null $template
@return string|null
Get the error message if exists .