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);
        }
    }