Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Markdown Response Laravel Package

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.

View on GitHub
Deep Wiki
Context7

title: Introduction weight: 1

AI agents increasingly consume web content. This package lets your Laravel app serve markdown versions of HTML pages, making your content more accessible to AI crawlers and tools.

Add the middleware to your routes, and you're done:

use Spatie\MarkdownResponse\Middleware\ProvideMarkdownResponse;

Route::middleware(ProvideMarkdownResponse::class)->group(function () {
    Route::get('/about', [PageController::class, 'show']);
    Route::get('/posts/{post}', [PostController::class, 'show']);
});

Now when an AI agent visits /about (or a user visits /about.md), it receives a clean markdown version of the page instead of HTML. Your existing controllers and views stay exactly the same.

The package detects markdown requests through three mechanisms: Accept: text/markdown headers, .md URL suffixes, and known AI bot user agents like GPTBot and ClaudeBot.

The HTML-to-markdown conversion is driver-based. The default driver uses league/html-to-markdown and works locally without any external services. You can also use the Cloudflare Workers AI API for better conversion quality.

Converted responses are cached by default, so repeated requests skip the conversion entirely.

We got badges

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle