PHPackages                             jeanpierregassin/laravel-geo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. jeanpierregassin/laravel-geo

ActiveLibrary

jeanpierregassin/laravel-geo
============================

Generative Engine Optimization (GEO) for Laravel: llms.txt, JSON-LD structured data, and AI crawler tooling.

0.1.1(yesterday)00GPL-3.0-or-laterPHP ^8.3

Since Jul 19Compare

[ Source](https://github.com/Jean-PierreGassin/laravel-geo)[ Packagist](https://packagist.org/packages/jeanpierregassin/laravel-geo)[ RSS](/packages/jeanpierregassin-laravel-geo/feed)WikiDiscussions Synced today

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

Laravel GEO
===========

[](#laravel-geo)

 [![Latest Version on Packagist](https://camo.githubusercontent.com/381acae9ebddb4478a527505af411bd6d56aa947a2717fad1fa34486af945236/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a65616e70696572726567617373696e2f6c61726176656c2d67656f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeanpierregassin/laravel-geo) [![Total Downloads](https://camo.githubusercontent.com/8399fda1aceb6faaa77ba8f2002b5928ed56879d0f8401ef3829308f1280ee5f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a65616e70696572726567617373696e2f6c61726176656c2d67656f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jeanpierregassin/laravel-geo) [![License](https://camo.githubusercontent.com/e2a98387dd7a17c9e94918019d3985636c59f118cfaf937de8b6afc5769473c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a65616e70696572726567617373696e2f6c61726176656c2d67656f2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

**Generative Engine Optimization (GEO) for Laravel**, the answer-engine equivalent of SEO. As users increasingly ask ChatGPT, Claude, Perplexity, and Google AI instead of typing queries into a search box, your application needs to describe itself to generative crawlers and adapt when one is visiting. Laravel GEO gives you three tools to do exactly that:

- **`llms.txt` endpoint**: publish a structured, Markdown site profile for AI crawlers at `/llms.txt`, following the [llmstxt.org](https://llmstxt.org) convention.
- **JSON-LD structured data**: emit a schema.org graph into your `` with a single Blade directive.
- **Generative engine detection**: identify requests from known AI crawlers and branch your responses on `request()->isFromGenerativeEngine()`.

Contents
--------

[](#contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
    - [Publishing an `llms.txt` profile](#publishing-an-llmstxt-profile)
    - [Emitting structured data](#emitting-structured-data)
    - [Detecting generative engines](#detecting-generative-engines)
    - [The `Geo` facade](#the-geo-facade)
- [Testing](#testing)
- [Contributing](#contributing)
- [Security](#security)
- [Credits](#credits)
- [License](#license)

Requirements
------------

[](#requirements)

DependencyVersionPHP`^8.3`Laravel`^11.0` | `^12.0` | `^13.0`Installation
------------

[](#installation)

Install the package via Composer:

```
composer require jeanpierregassin/laravel-geo
```

The service provider and `Geo` facade are registered automatically through Laravel's package discovery, so no further wiring is required.

Publish the configuration file to customise your site profile:

```
php artisan vendor:publish --tag=geo-config
```

To override the JSON-LD `` markup, publish the views as well:

```
php artisan vendor:publish --tag=geo-views
```

Configuration
-------------

[](#configuration)

The published `config/geo.php` file is organised into four sections:

KeyPurpose`site`The plain-language profile served at `/llms.txt`.`llms_txt`Whether the endpoint is registered, and at which path.`structured_data`The schema.org type and canonical URL emitted by the `@geo` directive.`engine_detection`Whether AI-crawler detection runs globally on the `web` middleware group.Every option is documented inline in the published file.

Usage
-----

[](#usage)

### Publishing an `llms.txt` profile

[](#publishing-an-llmstxt-profile)

Describe your site under the `site` key in `config/geo.php`. The profile is rendered as Markdown and served at `/llms.txt`:

```
'site' => [
    'name' => env('APP_NAME'),
    'summary' => 'What your product does, in one plain sentence.',
    'details' => 'An optional longer paragraph with additional context.',
    'sections' => [
        [
            'heading' => 'Documentation',
            'links' => [
                ['title' => 'Getting started', 'url' => '/docs', 'notes' => 'Start here'],
                ['title' => 'API reference', 'url' => '/docs/api'],
            ],
        ],
    ],
],
```

Change the route or disable the endpoint entirely under `llms_txt`:

```
'llms_txt' => [
    'enabled' => true,
    'path' => 'llms.txt',
],
```

The route is named `geo.llms_txt`, so you can reference it with `route('geo.llms_txt')`.

### Emitting structured data

[](#emitting-structured-data)

Add the `@geo` directive inside your layout's `` to emit a schema.org JSON-LD graph:

```

    @geo

```

The entity type and canonical URL are configurable under `structured_data`:

```
'structured_data' => [
    'type' => 'Organization', // any schema.org type
    'url' => env('APP_URL'),
],
```

The graph's `name` and `description` are drawn from your `site` profile, keeping both endpoints in sync.

### Detecting generative engines

[](#detecting-generative-engines)

Engine detection is enabled by default and runs on the `web` group. Two request macros let you branch on the visiting crawler anywhere you have the request:

```
use JeanPierreGassin\LaravelGeo\Enums\GenerativeEngine;

if ($request->isFromGenerativeEngine()) {
    $engine = $request->generativeEngine();

    if ($engine === GenerativeEngine::ClaudeBot) {
        // Serve a citation-friendly response.
    }
}
```

Each engine also carries its `vendor()` and a `type()` so you can branch on crawler *behaviour* rather than a specific product. The type is the GEO-relevant distinction: `Search` and `Agent` fetchers can cite and link back to your page, while `Training` crawlers only ingest content and return no attribution.

```
use JeanPierreGassin\LaravelGeo\Enums\GenerativeEngineType;

if ($request->generativeEngine()?->type() === GenerativeEngineType::Search) {
    // Invest in a rich, citation-friendly response for answer engines.
}
```

The `GenerativeEngine` enum recognises the following crawlers out of the box. Only tokens that appear in a real `User-Agent` header are detected; robots.txt opt-out tokens such as `Google-Extended` and `Applebot-Extended` are excluded because they never reach the server as a header.

VendorUser-Agent tokenTypeOpenAI`GPTBot`TrainingOpenAI`OAI-SearchBot`SearchOpenAI`ChatGPT-User`AgentAnthropic`ClaudeBot`TrainingAnthropic`Claude-SearchBot`SearchAnthropic`Claude-User`AgentGoogle`Google-CloudVertexBot`AgentGoogle`Google-NotebookLM`AgentPerplexity`PerplexityBot`SearchPerplexity`Perplexity-User`AgentApple`Applebot`SearchMicrosoft`bingbot`SearchAmazon`Amazonbot`TrainingMeta`meta-externalagent`TrainingMeta`meta-externalfetcher`AgentByteDance`Bytespider`TrainingMistral`MistralAI-User`AgentDuckDuckGo`DuckAssistBot`SearchCommon Crawl`CCBot`TrainingCohere`cohere-ai`TrainingYou.com`YouBot`SearchTo opt out of the global behaviour, set `engine_detection.enabled` to `false` and apply the `geo.detect` middleware alias to specific routes instead:

```
Route::middleware('geo.detect')->group(function () {
    // Detection runs only on these routes.
});
```

### The `Geo` facade

[](#the-geo-facade)

Every capability is also available programmatically through the `Geo` facade:

```
use JeanPierreGassin\LaravelGeo\Facades\Geo;

Geo::siteProfile();  // SiteProfile: the structured site profile
Geo::llmsTxt();      // string:      the rendered llms.txt Markdown document
Geo::schemaGraph();  // SchemaGraph: the schema.org graph advertised to engines
Geo::renderHead();   // string:      the JSON-LD  markup emitted by @geo
```

Testing
-------

[](#testing)

```
composer install
composer test          # run the PHPUnit suite
composer check-style   # check coding style (PHP-CS-Fixer, dry run)
composer fix-style     # apply coding-style fixes
```

Contributing
------------

[](#contributing)

Contributions are welcome. Please ensure the test suite passes and the coding style is clean (`composer test && composer check-style`) before opening a pull request.

Security
--------

[](#security)

If you discover a security vulnerability, please email  rather than using the issue tracker.

Credits
-------

[](#credits)

- [Jean-Pierre Gassin](https://github.com/jeanpierregassin)
- [All Contributors](../../contributors)

License
-------

[](#license)

GNU General Public License v3.0 or later (GPL-3.0-or-later). See [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6791304?v=4)[Jean-Pierre Gassin](/maintainers/Jean-PierreGassin)[@Jean-PierreGassin](https://github.com/Jean-PierreGassin)

---

Tags

laravelaigeoseollms-txtgenerative engine optimization

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/jeanpierregassin-laravel-geo/health.svg)

```
[![Health](https://phpackages.com/badges/jeanpierregassin-laravel-geo/health.svg)](https://phpackages.com/packages/jeanpierregassin-laravel-geo)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M238](/packages/laravel-ai)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M319](/packages/laravel-horizon)[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[illuminate/database

The Illuminate Database package.

2.8k54.9M12.1k](/packages/illuminate-database)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k21.5M663](/packages/laravel-boost)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
