Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

behnampmdg3's avatar

The best markup PHP code highlighter for Laravel

Hi;

What is the best markup PHP code highlighter for Laravel?

Basically for a forum that users can share posts with code.

Like Laracasts.

Thoughts on https://highlightjs.org/ ?

Thanks

0 likes
1 reply
D9705996's avatar
D9705996
Best Answer
Level 51

If you look at the HTML source for Laracasts you can see that Jeff uses hightlightjs

<script src="/highlight/highlight.pack.js" type="464cd3972b50c5b807f56e37-text/javascript"></script>

TBH there isn't a best solution as the right answer will depend on what languages you need to support, styles you want, etc but with 185 languages and 89 themes you probably wont go wrong with highlight, at least as a starting point.

I have used Prism.js which worked better for a particular integration but generally HighlightJs and is more popular

https://www.npmtrends.com/highlight.js-vs-prismjs

Please or to participate in this conversation.