hszope / laravel-aigeo
Generative Engine Optimization (GEO) for Laravel — get your products surfaced inside AI-generated answers from ChatGPT, Gemini, Perplexity and more.
Requires
- php: ^8.2
- illuminate/console: ^10.0|^11.0|^12.0|^13.0
- illuminate/database: ^10.0|^11.0|^12.0|^13.0
- illuminate/http: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0|^10.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
README
Generative Engine Optimization (GEO) for Laravel. Get your products surfaced inside AI-generated answers from ChatGPT, Gemini, Perplexity, Claude, and Bing AI.
Why GEO matters in 2026
Search is shifting from a list of blue links to direct, generated answers. AI answer engines (ChatGPT, Google Overviews, Perplexity) are becoming the primary discovery tool for users. If your content isn't optimized for these engines, you don't exist in the AI-first world.
Features
- llms.txt Generation: Automatically creates and serves
llms.txtto guide AI crawlers. - Rich JSON-LD Schema: Injects semantic metadata into your pages to help LLMs understand your products perfectly.
- GEO Scoring: Audit your products with a 0-100 score based on AI-critical signals.
- Citation Enrichment: Automatically adds stat-rich, citation-worthy data.
- AI Product Feed: Serves a specialized JSON feed designed specifically for LLM indexing.
- Visual Dashboard: A beautiful, premium interface to manage and audit your GEO performance.
- Blade Components: Simple tools to integrate GEO features into your existing views.
Dashboard Preview
Requirements
- PHP 8.2+
- Laravel 10, 11, or 12
Installation
composer require hszope/laravel-aigeo
Publish the config, migrations, and assets:
php artisan vendor:publish --tag="laravel-aigeo-config" php artisan vendor:publish --tag="laravel-aigeo-migrations" php artisan migrate
Quick Start
1. Add the Trait
Add the HasGeoProfile trait to any Model you want surfaced to AI (e.g. Product, Article, User).
use Hszope\LaravelAigeo\Traits\HasGeoProfile; class Product extends Model { use HasGeoProfile; // Map your database fields to the AI schema public function geoProfile(): array { return [ 'name' => $this->name, 'description' => $this->description, 'price' => $this->price, 'sku' => $this->sku, 'image' => $this->image_url, 'url' => url("/products/{$this->id}"), 'rating' => $this->average_rating ?? null, 'review_count' => $this->review_count ?? null, 'currency' => 'USD', 'in_stock' => true, 'attributes' => [ 'Brand' => $this->brand->name, ], ]; } }
2. Inject the AI Schema
Add the <x-geo-head> component to your layout's <head>. This will automatically inject highly optimized JSON-LD scripts on your product pages.
<head> <x-geo-head :model="$product" /> </head>
3. Setup Scheduled AI Feeds
To keep your llms.txt and ai-product-feed.json updated automatically for AI crawlers, add the following commands to your Laravel schedule (usually in routes/console.php or app/Console/Kernel.php):
use Illuminate\Support\Facades\Schedule; Schedule::command('geo:llms-txt')->daily(); Schedule::command('geo:feed')->daily();
Securing the Dashboard
The package comes with a built-in dashboard accessible at /geo.
By default, you should protect this route using Laravel middleware.
Open config/geo.php and configure your middleware and models:
'dashboard' => [ 'enabled' => true, 'path' => '/geo', 'middleware' => ['web', 'auth'], // Add 'auth' or your custom admin middleware here // Which models should show up in your Audit page? 'models' => [ ['model' => \App\Models\Product::class, 'label' => 'Products'], ['model' => \App\Models\Article::class, 'label' => 'Articles'], ], ],
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.





