spatie/laravel-markdown-response
Serve markdown versions of your Laravel HTML pages for AI agents and bots. Detect markdown requests via Accept: text/markdown, known user agents, or .md URLs. Driver-based conversion (local PHP or Cloudflare Workers AI), with caching and HTML preprocessing.
Besides automatic conversion via the middleware, you can convert HTML to markdown anywhere in your code using the Markdown facade:
use Spatie\MarkdownResponse\Facades\Markdown;
$markdown = Markdown::convert('<h1>Hello</h1><p>World</p>');
The conversion uses whichever driver is configured in markdown-response.driver and runs all configured preprocessors before converting.
You can switch drivers on the fly using the using() method:
$markdown = Markdown::using('cloudflare')->convert($html);
How can I help you explore Laravel packages today?