Weave 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

Llms Txt Bundle Laravel Package

silarhi/llms-txt-bundle

A Symfony bundle that automatically generates an llms.txt file for your site, exposing a clean, markdown-based index of your key pages and documentation so large language models can discover and understand your content.

View on GitHub
Deep Wiki
Context7

Getting Started

This is a Symfony bundle (silarhi/llms-txt-bundle), not a Laravel package — there is no service provider or config/llms-txt.php to publish. Everything below assumes a Symfony app; the mental model maps to Laravel (a route-level flag plus a generated artifact), but the wiring does not.

  • composer require silarhi/llms-txt-bundle, then register it in config/bundles.php (Symfony Flex does this for you).
  • Look first at your route definitions, not at the bundle. Content is opt-in per route via the llms_txt route option (attribute #[Route(..., options: ['llms_txt' => ...])] or YAML options:). No flagged routes → nothing meaningful in the output.
  • First use case: flag two or three public docs/marketing routes, hit /llms.txt, and confirm the rendered file lists exactly those and nothing else. That round-trip tells you more than the README.
  • Decide early whether you need discovery.link_header. It is off by default and, as of v1.3.0, is the only feature that pulls in symfony/web-link.

Implementation Patterns

  • Flag at the route layer, not in a controller. The option is the contract; keep it next to the route definition so it survives refactors and so it is visible in debug:router.
  • Treat /llms.txt as a build artifact, not a live view. Since v1.3.0 the routes carrying llms_txt are cached in %kernel.build_dir%/llms_txt_routes.php, alongside the compiled routes. In deployment, run cache:warmup as part of your build so the file exists before traffic arrives — this is what makes a read-only build directory work.
  • CI/deploy pipeline: cache:warmup → cache:clear is no longer just a performance nicety for this bundle; it is the difference between 1.8 ms and 15.9 ms responses at ~1,000 flagged routes (19 ms vs 720 ms at 10,000). Add warmup to the image build, not to the request path.
  • Debug loop: the route cache is invalidated together with the compiled routes, and a route file change rebuilds it in debug. If /llms.txt looks stale, you are almost certainly not in debug or did not warm up — same failure mode as any other compiled-route staleness.
  • Local dev for the discovery header: if you flip discovery.link_header on, composer require symfony/web-link in the same commit. Do not rely on it arriving transitively.
  • Where the bundle touches your app: this is a Symfony bundle, so integration points are config/bundles.php, route options, cache:warmup, and the Link header — not Laravel middleware, routes files, or Artisan commands.

Gotchas and Tips

  • symfony/web-link is now optional (v1.3.0). It was previously pulled in transitively. Two ways this bites:
    • You enable discovery.link_header without requiring it → the container build fails (not a runtime 500). Loud, but only if you build before you deploy.
    • Your app uses WebLink itself — preload()/link() Twig functions, AbstractController::addLink() — and was silently leaning on the bundle's dependency. That code now breaks; add composer require symfony/web-link explicitly. Audit for these calls when upgrading.
  • Invalid llms_txt options fail the /llms.txt requests, not the warmup. cache:warmup will succeed and your deploy goes green; the breakage surfaces on the first real request to the file. Do not treat a successful warmup as validation — smoke-test /llms.txt in your deploy pipeline or a post-deploy check.
  • Read-only build directories: the cache file lives under %kernel.build_dir%, so a container with a read-only build dir works only if cache:warmup ran at build time. Skipping warmup and mounting the build dir read-only will fail at request time.
  • Debug vs prod divergence: invalidation on route-file change only happens in debug. In prod, a route edit without a rebuild leaves both the compiled routes and llms_txt_routes.php stale — and they will be stale consistently, which makes it look like a bug in the bundle.
  • Extension point to watch: the cached file is a plain PHP array next to compiled routes. If you ever need to inspect why a route is or isn't listed, that file is the fastest source of truth — check it before reading the bundle's compiler pass.
  • Upgrade note: nothing here is a hard breaking change for a default install, but the WebLink decoupling is a silent-breakage risk for apps that used those helpers. Grep for preload(/addLink(/link( in templates and controllers before bumping to 1.3.0.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource