Spatie's Laravel Markdown Response package enables Laravel apps to serve clean markdown versions of HTML pages to AI crawlers and agents. It works at the middleware level with no controller or view changes required. Detection happens via Accept headers, .md URL suffixes, or known AI bot user agents like GPTBot and ClaudeBot. Conversion uses the league/html-to-markdown driver by default, with a Cloudflare Workers AI alternative available. Responses are cached automatically with a configurable TTL. PHP attributes can also control conversion at the controller or method level.
Sort: