original_string: 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);
          }
      }
code: 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);
          }
      }
code_tokens: 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 ) ; } }
docstring: Get the error message if exists.
  
  @param  string $name
  @param  string|null $template
  @return string|null
docstring_tokens: Get the error message if exists .