Laravel Markdown
A CommonMark wrapper for Laravel with first-class Blade view integration.
Repository Health
Technical Analysis
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
Markdownfacade 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.phpview 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.