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

ImanGh's avatar

Laravel 5 - Elixir-jade : Say hello to jade

after almost more than a year of hoping to use jade syntax along side the laravel... eventually... I found it very joyful to use jade with the npm package laravel-elixir-jade.

it can remove a lot of extra markup from my views. in my opinion using jade ( => html ) is as nice as using coffeeScript ( => javaScript) or Sass ( => Css ).

the setup was very easy and I got up and running in no time.

you can use this gist as a jade mixin library to output blade ready files. https://gist.github.com/imanghafoori1/7eeb0ffe9d205acc9210

The Idea is to write .jade files and use elixir to compile them into .blade.php files in dev stage. (not to replace the blade with jade syntax on server-side which might seem a hacky solution.) see also : http://jade-lang.com _ _ http://html2jade.org

0 likes
5 replies
psteenbergen's avatar

Hi @ImanGh,

This looks like a great usage for the laravel-elixer-jade plugin. Where do you put these within your project? Or do you include it in the templates you want to generate from .jade to .blade.php

Greetings, Peter

ImanGh's avatar

I create a file and include it in my jade files. where I want to use +if instead of |@if

nuklehed's avatar

I know this is an old topic, but I like using jade so much I had to share!

I place my jade into subfolders under /resources/assets/jade. When gulp compiles jade, it places the blade.php files into their respective subfolders under /resources/views. For example, if my jade is /resources/assets/jade/clients/index.jade, it compiles to /resources/views/clients/index.blade.php.

Please or to participate in this conversation.