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

princeoo7's avatar

How to Integrate Prismjs in laravel and vue

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 ?

0 likes
1 reply

Please or to participate in this conversation.