This is a CSS-based solution that relies on the default bootstrap.js collapse implementation. No additional HTML markup required (feel free to replace Font-Awesome with glyphicons, of course).
<style>
.panel-title > a:before {
font-family: FontAwesome;
content: "f07c";
padding-right: 5px;
}
.panel-title > a.collapsed:before {
content: "f07b";
}
</style>
DEMO (Bootstrap 3.3.7):
DEMO (Bootstrap 4.0 / Font Awesome 5 CSS):
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…