pug-php/pug-filter-markdown
A Pug filter for the pug-php templating engine that renders Markdown directly inside your templates. Install it to convert Markdown blocks to HTML at compile time, keeping your Pug views clean and readable.
composer require <vendor>/<package>
php artisan vendor:publish --tag=pug-config
config/pug.php (or the package’s published config) for:
.pug)pretty, extension, and custom keywords/filtersresources/views/welcome.pug and return it like any Laravel view:
Route::get('/', fn () => view('welcome', ['name' => 'Taylor']));
doctype html
html
body
h1 Hello #{name}
pug-php/pug dependency constraint resolves to ^3.0 and that your PHP version meets Pug-php 3’s requirements..blade.php views and introduce .pug views incrementally. Laravel resolves views by extension, so both can coexist. This is the lowest-risk migration path.//- resources/views/layouts/app.pug
doctype html
html
body
block content
//- resources/views/dashboard.pug
extends layouts/app
block content
h1 Dashboard
include partials/nav
view('name', $data) API as Blade. In Pug, #{value} escapes output and !{value} renders unescaped HTML. Prefer #{} for user-supplied data.mixin button(label, variant='primary')
button(class=`btn btn-${variant}`)= label
+button('Save')
+button('Cancel', 'secondary')
pretty output in local development for readable HTML, and enable compiled-template caching in production. Clear caches during deployment.assertSee() continue to work without special handling.composer.json and run the full test suite after upgrading..pug files.!{} does not escape output. Avoid it with user data; use #{} or explicit sanitization.@csrf, @if, @foreach, and similar Blade constructs are not processed in .pug views. Use Pug conditionals/loops or the PHP expressions supported by Pug-php. For CSRF fields, render the token through view data or a custom Pug helper/filter.php artisan view:clear
If errors reference generated PHP rather than your .pug file, inspect the compiled cache.How can I help you explore Laravel packages today?