Level 31
You could try this blog post:
https://cylab.be/blog/222/syntax-highlighting-with-prismjs-for-your-laravel-application
Only thing on that post is they don't tell you how to integrate the CSS with Mix.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I wish to know how to integrate prismjs in laravel and vuejs.
i did
npm install prismjs --save
then will do
import Prism from 'prismjs';
after this what ?
official documentation say's
var Prism = require('prismjs');
var loadLanguages = require('prismjs/components/');
loadLanguages(['haml']);
// The code snippet you want to highlight, as a string
var code = "= ['hi', 'there', 'reader!'].join \" \"";
// Returns a highlighted HTML string
var html = Prism.highlight(code, Prism.languages.haml, 'haml');
but this is only for one language. what we want support for multiple languages ? like php, python, html5 or css and more ?
how it is done on laracast ?
Please or to participate in this conversation.