{"id":44868124,"url":"https://github.com/spatie/laravel-markdown-response","last_synced_at":"2026-02-23T18:02:30.378Z","repository":{"id":338889544,"uuid":"1159536909","full_name":"spatie/laravel-markdown-response","owner":"spatie","description":"Serve markdown versions of your HTML pages to AI agents and bots","archived":false,"fork":false,"pushed_at":"2026-02-19T16:44:54.000Z","size":94,"stargazers_count":40,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-21T20:37:09.807Z","etag":null,"topics":["ai","laravel","markdown","php"],"latest_commit_sha":null,"homepage":"https://spatie.be/docs/laravel-markdown-response","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spatie.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"docs/support-us.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"Spatie"}},"created_at":"2026-02-16T21:07:55.000Z","updated_at":"2026-02-21T19:20:41.000Z","dependencies_parsed_at":"2026-02-18T13:00:49.089Z","dependency_job_id":null,"html_url":"https://github.com/spatie/laravel-markdown-response","commit_stats":null,"previous_names":["spatie/laravel-markdown-response"],"tags_count":4,"template":false,"template_full_name":"spatie/package-skeleton-laravel","purl":"pkg:github/spatie/laravel-markdown-response","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-markdown-response","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-markdown-response/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-markdown-response/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-markdown-response/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spatie","download_url":"https://codeload.github.com/spatie/laravel-markdown-response/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatie%2Flaravel-markdown-response/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29719264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","laravel","markdown","php"],"created_at":"2026-02-17T12:00:41.777Z","updated_at":"2026-02-22T17:00:42.842Z","avatar_url":"https://github.com/spatie.png","language":"PHP","funding_links":["https://github.com/sponsors/Spatie"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"left\"\u003e\n    \u003ca href=\"https://spatie.be/open-source?utm_source=github\u0026utm_medium=banner\u0026utm_campaign=laravel-markdown-response\"\u003e\n      \u003cpicture\u003e\n        \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://spatie.be/packages/header/laravel-markdown-response/html/dark.webp\"\u003e\n        \u003cimg alt=\"Logo for laravel-markdown-response\" src=\"https://spatie.be/packages/header/laravel-markdown-response/html/light.webp\"\u003e\n      \u003c/picture\u003e\n    \u003c/a\u003e\n\n\u003ch1\u003eServe markdown versions of your HTML pages to AI agents and bots\u003c/h1\u003e\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-markdown-response.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-markdown-response)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/spatie/laravel-markdown-response/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/spatie/laravel-markdown-response/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/spatie/laravel-markdown-response/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/spatie/laravel-markdown-response/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-markdown-response.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-markdown-response)\n\n\u003c/div\u003e\n\nAI agents increasingly consume web content. This package lets your Laravel app serve markdown versions of HTML pages — detected via `Accept: text/markdown` header, known AI user agent patterns, or `.md` URL suffix. The conversion is driver-based (local PHP, Cloudflare Workers AI, or markdown.new), results are cached, and HTML can be preprocessed before conversion.\n\nHere's a quick example:\n\n```php\nuse Spatie\\MarkdownResponse\\Middleware\\ProvideMarkdownResponse;\n\nRoute::middleware(ProvideMarkdownResponse::class)-\u003egroup(function () {\n    Route::get('/about', [PageController::class, 'show']);\n    Route::get('/posts/{post}', [PostController::class, 'show']);\n});\n```\n\nNow when an AI agent visits `/about` or a user visits `/about.md`, they receive a clean markdown version of the page.\n\nYou can also convert HTML to markdown directly:\n\n```php\nuse Spatie\\MarkdownResponse\\Facades\\Markdown;\n\n$markdown = Markdown::convert($html);\n```\n\nAnd test your conversions:\n\n```php\nuse Spatie\\MarkdownResponse\\Facades\\Markdown;\n\nit('converts the about page to markdown', function () {\n    Markdown::fake();\n\n    $this-\u003eget('/about.md')-\u003eassertOk();\n\n    Markdown::assertConverted();\n});\n```\n\n## Support us\n\n[\u003cimg src=\"https://github-ads.s3.eu-central-1.amazonaws.com/laravel-markdown-response.jpg?t=1\" width=\"419px\" /\u003e](https://spatie.be/github-ad-click/laravel-markdown-response)\n\nWe invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).\n\nWe highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).\n\n## Documentation\n\nAll documentation is available [on our documentation site](https://spatie.be/docs/laravel-markdown-response).\n\n## Testing\n\nYou can run the tests with:\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Freek Van der Herten](https://github.com/freekmurze)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Flaravel-markdown-response","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspatie%2Flaravel-markdown-response","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatie%2Flaravel-markdown-response/lists"}