pug-php/pug-filter-less
A Pug filter for the PHP Pug templating engine that compiles Less stylesheets. Write Less inside your templates with a :less block and get processed CSS at render time, streamlining asset handling for PHP projects.
This release is narrow: 1.1.0 adds Pug-php 3 compatibility. Treat it as a dependency-alignment release, not a feature release. If your app already uses pug-php/pug 3.x, upgrade the Laravel integration to ^1.1 and verify template rendering. If you are still on Pug-php 2.x, check whether 1.1.0 still supports it before upgrading; the release note does not say whether 2.x support was dropped or widened.
Minimal setup:
composer.json for the integration package and pug-php/pug constraints.composer require <laravel-pug-integration>:^1.1 pug-php/pug:^3 --with-dependencies
Use the actual package name from your composer.json; do not copy the placeholder.pretty, and expression/option settings..pug file under resources/views and render it with Laravel’s normal view() helper.Where to look first:
composer.json for the Pug-php 3 constraint..blade.php and .pug files exist for the same view name.First use case: replace a Blade layout/page with Pug for markup-heavy screens.
resources/views/layouts/app.pug:
doctype html
html
head
title= $title
body
block content
resources/views/home.pug:
extends layouts/app
block content
h1 Hello #{$userName}
p Welcome to the dashboard.
Controller:
return view('home', [
'title' => 'Home',
'userName' => $user->name,
]);
Use Pug where its indentation-based syntax and mixins reduce markup noise, but keep Laravel application logic in controllers, view composers, and small view models.
Common day-to-day patterns:
extends and block. Keep one or two base layouts and override blocks per page. This is the main replacement for Blade’s @extends/@section.include. Use includes for navigation, footer, pagination, and repeated static fragments.mixin button(label, href)
a.btn(href=href)= label
Then use +button('Save', '/save').view()->share() or composers than repeated controller arrays.assertSee() or render the view directly. This catches indentation, missing variables, and cache issues before deploy.pug-php/pug; avoid floating versions in production.home.blade.php and home.pug both exist, the view finder’s extension order decides which wins. Use distinct names during migration or confirm the package registers .pug in the order you expect.php artisan view:clear and, if config was changed, php artisan config:clear. Stale compiled Pug templates can make fixes appear not to work.How can I help you explore Laravel packages today?