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.
/about.md). Supports initiatives like "Unify content delivery" or "Reduce technical debt."Markdown::fake()) simplify CI/CD pipelines for markdown conversion logic, ensuring regressions are caught early.Adopt if:
Look elsewhere if:
text/html → text/markdown."This package lets us serve clean, AI-friendly markdown versions of our web content automatically—without rewriting our existing Laravel app. Think of it like adding a 'markdown mode' for search engines and AI tools, which can improve our visibility in generative AI results (e.g., Google’s SGE, Bing Chat). It’s a low-risk, high-reward way to future-proof our content for the AI era, with minimal dev effort. We can toggle it on/off globally or per-page, and it caches responses to avoid performance hits."
Key Outcomes:
*"This solves a growing pain point: AI agents can’t parse our HTML well, leading to incomplete or noisy responses. The package adds a middleware that:
Accept: text/markdown, .md URLs, or bot UAs).Why this over DIY?
#[ProvideMarkdown]), global middleware, or per-route opt-outs.Markdown::fake()).Tradeoffs:
Next Steps:
/docs and /blog route groups first.*"This lets us control how our content appears in AI tools—no more fighting bloated HTML. For example:
No changes needed to your existing templates—just add a middleware or .md URL suffix. We can also use attributes to exclude sensitive pages (e.g., dashboards)."*
How can I help you explore Laravel packages today?