finds.dev← search

// the find

GrahamCampbell/Laravel-Markdown

★ 1,344 · PHP · MIT · updated May 2026

A CommonMark wrapper for Laravel

A thin Laravel service provider wrapping the league/commonmark library. It wires CommonMark into Laravel's IoC container, adds a Blade directive, and lets you use .md/.md.php/.md.blade.php files as first-class view templates. If you're already using Laravel and want markdown rendering without rolling your own binding, this saves about 20 minutes of setup.

The view engine integration is the genuinely useful part — treating .md files as views means you can mix Blade and Markdown naturally without a custom preprocessor. Configuration is done through a standard Laravel config file, so all the CommonMark options (html_input, extensions, nesting level) are centrally managed. The extension list in config accepts any CommonMark extension class and resolves it from the container, so adding GFM autolinks or footnotes is one line. Long maintenance history with a clean compatibility matrix going back to L5.5 and forward to L13.

This is a glorified service provider — the actual parsing work is entirely delegated to league/commonmark, so you're adding a dependency for what amounts to 3 files of glue code most teams could write themselves in an afternoon. The default `allow_unsafe_links: true` is a footgun; anyone rendering user-supplied markdown will need to remember to flip that in config, and it's not called out as dangerous in the docs. No caching layer: every convert() call re-parses from scratch, which matters if you're rendering markdown from a database on every request. There's no mention of sanitizing the HTML output beyond the html_input setting, so XSS from malicious markdown input is your problem to solve.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →