Download the PHP package daikazu/laravel-llm-ready without Composer
On this page you can find all versions of the php package daikazu/laravel-llm-ready. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download daikazu/laravel-llm-ready
More information about daikazu/laravel-llm-ready
Files in daikazu/laravel-llm-ready
Package laravel-llm-ready
Short Description Serve LLM-optimized markdown versions of your Laravel pages by appending .md to any URL.
License MIT
Homepage https://github.com/daikazu/laravel-llm-ready
Informations about the package laravel-llm-ready
Serve LLM-optimized markdown versions of your Laravel pages by appending .md to any URL.
Purpose
Large Language Models (LLMs) like ChatGPT and Claude work much better with clean markdown than parsing HTML. This package automatically converts your Laravel pages to markdown, making your site more accessible to AI crawlers, tools, and users who want to feed your content to LLMs.
Features
- Automatic Markdown Conversion: Append
.mdto any URL or use?format=md - Smart Content Extraction: Configurable CSS selectors find your main content
- Table Support: HTML tables converted to GitHub Flavored Markdown tables
- Eyebrow Detection: Automatically detects and formats eyebrow/label text
- YAML Frontmatter: Includes title, description, URL, and timestamps
- Caching: TTL-based caching with artisan command for manual invalidation
- llms.txt Endpoint: Spec-compliant sitemap at
/llms.txt(llmstxt.org) - Markdown Discovery: Automatic
Linkheader,@llmReadyBlade directive, andllmReadyUrl()helper - Route Exclusions: Pattern-based exclusions for admin, API, and other routes
- Redirect Handling: Automatically follows redirects (e.g.,
/blog->/blog/) - Extensible: Swap the content extractor with your own implementation
Requirements
- PHP 8.4+
- Laravel 12.x
Installation
The package will auto-discover and register itself.
Publish Configuration (Optional)
Server Configuration
Your web server needs to pass .md requests to Laravel instead of trying to serve them as static files.
Apache
The default Laravel .htaccess should work. Ensure it contains:
Nginx
Add this to your server block:
Laravel Valet/Herd
Works out of the box - no configuration needed.
Usage
Accessing Markdown Versions
There are three ways to get the markdown version of a page:
llms.txt Endpoint
The /llms.txt endpoint follows the llmstxt.org specification, providing LLMs with structured information about your site:
Example output:
Markdown Discovery
LLMs and crawlers need a way to discover that a markdown version of a page exists. This package provides three complementary mechanisms:
Automatic Link Header
Every HTML response automatically includes a Link header pointing to the markdown version:
This is enabled by default. Disable it via config or environment variable:
Blade Directive
Add a <link> tag to your templates so crawlers can discover the markdown version via HTML:
The directive is opt-in — it only outputs when you use it, and returns an empty string for excluded routes or when the package is disabled.
Helper Function
Use llmReadyUrl() in programmatic contexts like SEO middleware (e.g., romanzipp/laravel-seo):
Clear Cache
Configuration
Output Example
Requesting /about-us.md produces clean markdown:
Configuring llms.txt
The llms.txt endpoint can be fully customized to provide curated information to LLMs:
Custom Content Extractor
Create your own extractor by implementing ContentExtractorInterface:
Then update your config:
Environment Variables
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Mike Wall
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-llm-ready with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
league/html-to-markdown Version ^5.1
symfony/css-selector Version ^7.0|^8.0
symfony/dom-crawler Version ^7.0|^8.0.0
symfony/yaml Version ^7.0|^8.0.0