Laravel Markdown

A CommonMark wrapper for Laravel with first-class Blade view integration.

Library
Composer
vv16.1.0
1,346stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
50/100Fair
Development Activity16
Maintenance32
Community64
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture80
Code Quality84
Innovation72
Learning Curve85

Laravel Markdown is a CommonMark wrapper for Laravel, created and maintained by Graham Campbell. It bridges the widely used league/commonmark parser into the Laravel framework, giving you a clean, injectable service and facade for converting Markdown to HTML.

Beyond programmatic rendering, it ships with integration into Laravel’s view system, so you can render Markdown directly inside Blade templates through a custom compiler and directive. Configuration is publishable, letting you enable CommonMark extensions and tune parsing options to match your application’s needs.

What You Get

  • A Markdown facade and injectable renderer for converting Markdown strings to HTML
  • Blade view integration via a dedicated Markdown compiler engine
  • A publishable config file to enable CommonMark extensions and options
  • Seamless use of the maintained league/commonmark parser under the hood
  • Support for current Laravel and PHP versions with active security policy

Common Use Cases

  • Rendering user-authored Markdown content to HTML in a Laravel app
  • Writing .md.blade.php view templates that compile Markdown to HTML
  • Centralizing Markdown parsing configuration across a Laravel codebase

Under The Hood

Architecture - A MarkdownServiceProvider binds a CommonMark converter into the container using the package’s config, registers the Markdown facade, and (in src/View) adds a Blade-compatible view engine so .md templates are compiled through the same renderer. The public surface is intentionally thin, delegating all parsing to league/commonmark.

Tech Stack - Pure PHP built directly on league/commonmark and illuminate/contracts/illuminate/support, tracking current Laravel and PHP releases. CI runs via GitHub Actions with the tests workflow shown in the README badges.

Code Quality - The repository follows Graham Campbell’s well-known packaging conventions: a PHPUnit test suite, StyleCI formatting, security policy, and contribution guidelines, reflecting mature and disciplined maintenance despite a small codebase.

API Design - Usage is minimal and idiomatic: inject the renderer or call Markdown::convertToHtml(), or write Markdown view files that Laravel compiles automatically. Publishable config keeps extension configuration declarative, so the learning curve is very low for Laravel developers.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search