Download the PHP package schaefersoft/laravel-llms-txt without Composer

On this page you can find all versions of the php package schaefersoft/laravel-llms-txt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-llms-txt

laravel-llms-txt

Latest Version on Packagist Tests Total Downloads

Automatically generate llms.txt and llms-full.txt files for your Laravel application — helping AI models understand your website, just like sitemap.xml helps search engines.

Built according to the llmstxt.org specification.

Requirements: PHP 8.2+ and Laravel 10, 11, 12, or 13.


Table of Contents


Installation

Publish the configuration file:

That's it. The package is auto-discovered by Laravel, and /llms.txt is available immediately.


Quick Start

The package works in two modes:

  1. Zero-config — Without any setup, /llms.txt is automatically generated from all registered GET routes in your application. Internal routes (Telescope, Horizon, Debugbar) and routes with URI parameters are excluded. Additional routes can be excluded via the exclude_routes config option.

  2. Custom definition (recommended) — Register a configure callback to have full control over the output. It always takes precedence over auto-generation.

This produces:

Tip: For larger projects, consider a dedicated LlmsTxtServiceProvider to keep your AppServiceProvider clean.


Building Your Document

Title and Description

Every document starts with a title and an optional description:

Both methods accept a string or a Closure for lazy evaluation (useful for localization):

Sections and Entries

Sections group related entries under a heading. Entries are links with a title, URL, and optional description.

Verbose style — useful when you need to store references to entries:

Fluent Shorthand

For a more compact style, use section() and entry() directly on the builder:

create() and make() are identical — use whichever you prefer.

Note: The entry() shorthand returns the Section, not the Entry. To call methods on the Entry itself (e.g. description()), use Entry::create() with addEntry() — or simply pass the description as the third argument to entry().

Model-Based Entries

Use entries() on a section to map a collection of models (or any iterable) into entries. The callback receives each item and must return an Entry instance.

You can combine entry() and entries() freely in the same section:

Conditional Content

Both LlmsTxt and Section support a when() method that mirrors Laravel's own when():

You can also pass a Closure as the condition for lazy evaluation:


Configuration

After publishing, the config file is at config/llms-txt.php:

Option Default Description
route_enabled true Enable or disable the HTTP routes entirely.
llms_txt_route '/llms.txt' URL path for the standard file.
llms_full_txt_route '/llms-full.txt' URL path for the full file.
full_route_enabled false Serve llms-full.txt dynamically. Disabled by default — see llms-full.txt.
register_routes true Auto-register routes. Set to false for manual registration.
cache_enabled true Cache rendered output.
cache_ttl 3600 Cache lifetime in seconds.
disk null Output location for static files. null writes directly into the public/ folder; set a disk name to use a filesystem disk.
exclude_routes [] URI or route-name patterns (with * wildcards) to exclude from auto-generation.
locales [] List of supported locales (e.g. ['en', 'de']).
localize_routes false Register locale-prefixed routes like /en/llms.txt.

Routes

Automatic Route Registration

By default, the package registers one route:

Route Description
GET /llms.txt Serves the standard llms.txt output.

A second route, GET /llms-full.txt, is only registered when full_route_enabled is set to true — see llms-full.txt for why it is opt-in.

Routes are registered automatically when register_routes is true (the default).

Excluding Routes from Auto-Generation

In zero-config mode the document is built from all registered GET routes. Use exclude_routes to keep specific routes out of the output. Patterns are matched against both the route URI and the route name, and support the * wildcard:

Manual Route Registration

To apply custom middleware or headers, disable automatic registration and call LlmsTxt::routes() yourself:

LlmsTxt::routes() is idempotent — it is safe to call more than once.


Localization

Translating Content

A single configure callback covers all locales. The package sets the application locale before invoking your callback, so __() and route() return the correct values automatically.

Create your language files as usual:

Locale-Prefixed Routes

Enable locale-prefixed routes to serve translated versions at /en/llms.txt, /de/llms.txt, etc.:

Unknown locale segments return a 404 response.

Using mcamara/laravel-localization

If you use mcamara/laravel-localization, disable automatic registration and wrap the routes in a localized group:


Static File Generation

Artisan Command

Generate static files with the llms:generate command:

By default, files are written directly into your application's public/ folder, so public/llms.txt is immediately served at https://your-app.test/llms.txt. To write to a filesystem disk instead (e.g. s3), set the disk config option.

Programmatic Export

You can also write files to disk from code:


llms-full.txt

The full variant fetches the content of each entry URL and appends it below the entry. URLs that cannot be fetched are silently skipped.

Serving llms-full.txt Dynamically

The /llms-full.txt route is disabled by default: on a cache miss it performs an HTTP request to every entry URL — which is slow, usually calls back into your own application, and lets any visitor trigger outbound traffic.

The recommended approach is generating a static file instead:

If you understand the trade-offs and want the dynamic route anyway, enable it explicitly:

With cache_enabled => true (the default), the fetched content is cached for cache_ttl seconds, so the entry URLs are only fetched once per TTL.


Caching

When cache_enabled is true (the default), rendered output is cached for the duration specified by cache_ttl.

You can also clear the cache from the command line:

Note: php artisan llms:generate flushes the cache automatically after a successful run, so the dynamic routes immediately reflect the new content.


Output Format

llms.txt

llms-full.txt

Same structure as llms.txt, but with the fetched HTML/text content of each URL appended below its entry.


Testing

License

MIT — see LICENSE.


All versions of laravel-llms-txt with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
illuminate/filesystem Version ^10.0|^11.0|^12.0|^13.0
illuminate/cache Version ^10.0|^11.0|^12.0|^13.0
guzzlehttp/guzzle Version ^7.15.2 || ^8.0.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package schaefersoft/laravel-llms-txt contains the following files

Loading the files please wait ...