spatie/laravel-markdown-response
Serve clean markdown versions of your Laravel HTML pages for AI agents and bots. Detects requests via Accept: text/markdown, known user agents, or .md URLs. Driver-based conversion (local PHP or Cloudflare Workers AI), caching, and HTML preprocessing included.
.md endpoints or AI user-agent detection without modifying existing controllers/views. Supports progressive enhancement.Markdown::fake()) accelerates QA for AI integrations or content migrations.curl --header "Accept: text/markdown" https://example.com/about).Adopt if:
.md URLs or Accept: text/markdown headers without rewriting routes/controllers.Look elsewhere if:
"This package lets us serve clean, AI-friendly markdown versions of our web content—automatically—without touching our existing codebase. Think of it as a ‘dark mode’ for AI: instead of sending bloated HTML to bots like ChatGPT, we deliver structured markdown, improving parsing accuracy and reducing API costs. It’s a low-risk, high-reward play for our AI integrations, documentation, or knowledge graph initiatives. The caching layer ensures no performance hit, and the Cloudflare driver option future-proofs us for richer content."
*"Spatie’s laravel-markdown-response gives us three ways to serve markdown:
.md URLs (e.g., /about.md).Accept: text/markdown headers for programmatic access.Markdown::convert($html).
It’s middleware-based (zero controller changes), supports League (local) or Cloudflare (serverless) drivers, and includes caching + testing tools. We can roll it out incrementally—start with docs or public APIs—and disable it entirely if needed (MARKDOWN_RESPONSE_ENABLED=false). The MIT license and Spatie’s track record make it a safe bet."**"This unlocks AI agents to consume our content more effectively. For example:
/support or /pricing to improve response quality..md to URLs or let the middleware handle it. We can A/B test impact on AI interactions."*How can I help you explore Laravel packages today?