PHPackages                             intent/intent-seo - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. intent/intent-seo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

intent/intent-seo
=================

AI-powered SEO optimization package for Intent Framework. Forked from rumenx/php-seo and modified exclusively for Intent Framework integration.

v2.0.0(4mo ago)01[2 PRs](https://github.com/aamirali51/intent-seo/pulls)MITPHPPHP ^8.2CI passing

Since Jan 3Pushed 1mo agoCompare

[ Source](https://github.com/aamirali51/intent-seo)[ Packagist](https://packagist.org/packages/intent/intent-seo)[ Docs](https://github.com/aamirali51/intent-seo)[ RSS](/packages/intent-intent-seo/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (12)Versions (5)Used By (0)

Intent SEO
==========

[](#intent-seo)

[![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)[![PHP 8.2+](https://camo.githubusercontent.com/0f16581d1180dbfd4c0e13166ec1267d4ad2f2fab8281ea6d6b284cf5c65d921/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d626c75652e737667)](https://www.php.net/)[![Intent Framework](https://camo.githubusercontent.com/967f3c115d2c74ae1e116bb9cd62be7f246dc337d8461c8c562dbfb3059e4a61/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f496e74656e742d4672616d65776f726b2d707572706c652e737667)](https://github.com/aamirali51/Intent-Framework)[![Packagist](https://camo.githubusercontent.com/40973b2cb36da5deb351651e9c034c6d476232141976ccf0983bddda827894db/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5061636b61676973742d76322e302e302d6f72616e67652e737667)](https://packagist.org/packages/intent/intent-seo)

> **AI-powered SEO optimization for Intent Framework applications.**

---

⚠️ Important Disclaimer
-----------------------

[](#️-important-disclaimer)

Caution

**This package is a fork of [rumenx/php-seo](https://github.com/RumenDamyanov/php-seo) by [Rumen Damyanov](https://github.com/RumenDamyanov).**

It has been **modified exclusively for Intent Framework** and **will NOT work** with Laravel, Symfony, or standalone PHP projects.

**For non-Intent Framework projects, please use the original package:**

```
composer require rumenx/php-seo
```

The original author deserves full credit for the excellent foundation this package is built upon. Please consider [supporting his work](https://github.com/sponsors/RumenDamyanov).

---

✨ Features
----------

[](#-features)

### 🤖 AI-Powered Automation

[](#-ai-powered-automation)

- **Intelligent Content Analysis**: AI generates optimal titles, descriptions, and meta tags
- **Image Analysis**: Automatically generates alt text for images
- **Multi-Provider Support**: GPT-4o, Claude 3.5, Gemini 1.5, Grok, Ollama

### 🚀 CMS-Grade SEO (v2.0)

[](#-cms-grade-seo-v20)

- **XML Sitemap Generator**: With image support and caching
- **Robots.txt Generator**: Fluent API
- **Schema.org Builders**: Article, WebPage, Breadcrumb, Organization, Product
- **Advanced Meta Controls**: Canonical, pagination, robots, Open Graph, Twitter Cards

### 💎 Intent Framework Integration

[](#-intent-framework-integration)

- **SeoMiddleware**: Auto-initializes SEO
- **Helper Functions**: `seo()`, `sitemap()`, `robots()`
- **Single Render**: `{{ seo().render()|raw }}` outputs all SEO tags

---

📦 Installation
--------------

[](#-installation)

```
composer require intent/intent-seo
```

### Requirements

[](#requirements)

- PHP 8.2+
- Intent Framework 0.6+

---

🚀 Quick Start
-------------

[](#-quick-start)

### 1. Add Middleware to Route

[](#1-add-middleware-to-route)

```
use Intent\Seo\SeoMiddleware;

Route::get('/blog/{slug}', $handler)->middleware(SeoMiddleware::class);
```

### 2. Configure SEO in Handler

[](#2-configure-seo-in-handler)

```
seo()->title('My Page Title')
     ->description('Page description here')
     ->canonical('https://example.com/page')
     ->image('https://example.com/image.jpg')
     ->addSchema(Schema::article()
         ->headline('Article Title')
         ->author('Author Name')
         ->publishDate('2026-01-04')
         ->build());
```

### 3. Render in Twig

[](#3-render-in-twig)

```

    {{ seo().render()|raw }}

    {% block content %}{% endblock %}

```

**Output:**

```

My Page Title

{"@context":"https://schema.org"...}

```

---

📖 Full API
----------

[](#-full-api)

### SeoManager Methods

[](#seomanager-methods)

```
seo()->title('Page Title')              // Set title
     ->description('Description')       // Set meta description
     ->canonical('https://...')         // Set canonical URL
     ->robots(true, true)               // index, follow
     ->prev('/page?p=1')                // Previous page (pagination)
     ->next('/page?p=3')                // Next page (pagination)
     ->openGraph('type', 'article')     // Open Graph meta
     ->twitter('site', '@handle')       // Twitter Card meta
     ->image('/image.jpg')              // Social image (OG + Twitter)
     ->addSchema($schema)               // Add JSON-LD schema
     ->render();                        // Output all HTML for
```

---

📝 XML Sitemap
-------------

[](#-xml-sitemap)

```
use Intent\Seo\Sitemap\SitemapGenerator;

Route::get('/sitemap.xml', function ($req, $res) {
    $sitemap = new SitemapGenerator();

    $sitemap->addUrl('https://example.com/', '2026-01-04', 'daily', 1.0);
    $sitemap->addUrl('https://example.com/about', null, 'monthly', 0.8);

    // Add from database
    $pages = DB::table('pages')->where('status', 'published')->get();
    foreach ($pages as $page) {
        $sitemap->addUrl(
            url('/pages/' . $page['slug']),
            $page['updated_at'],
            'weekly',
            0.7,
            [['loc' => $page['image'], 'title' => $page['title']]]  // Image sitemap
        );
    }

    return $res->header('Content-Type', 'application/xml')->send($sitemap->generate());
});
```

---

🤖 Robots.txt
------------

[](#-robotstxt)

```
use Intent\Seo\Robots;

Route::get('/robots.txt', function ($req, $res) {
    $robots = Robots::default('https://example.com');
    // Or customize:
    // $robots = new Robots();
    // $robots->allow('/')->disallow('/admin')->sitemap('https://example.com/sitemap.xml');

    return $res->header('Content-Type', 'text/plain')->send($robots->generate());
});
```

---

📊 Schema.org Builders
---------------------

[](#-schemaorg-builders)

```
use Intent\Seo\Schema\Schema;

// Article
$article = Schema::article()
    ->headline('Article Title')
    ->author('Author Name')
    ->publishDate('2026-01-04')
    ->image('https://example.com/image.jpg')
    ->publisher('Site Name', 'https://example.com/logo.png');

seo()->addSchema($article);

// Breadcrumb
$breadcrumb = Schema::breadcrumb()
    ->add('Home', '/')
    ->add('Blog', '/blog')
    ->add('Article', '/blog/article');

seo()->addSchema($breadcrumb);

// Organization
$org = Schema::organization()
    ->name('Company Name')
    ->url('https://example.com')
    ->logo('https://example.com/logo.png')
    ->sameAs(['https://twitter.com/...', 'https://facebook.com/...']);

// Product (E-commerce)
$product = Schema::product()
    ->name('Product Name')
    ->description('Product description')
    ->price(99.99, 'USD')
    ->availability('InStock')
    ->rating(4.5, 120);
```

---

⚙️ Configuration
----------------

[](#️-configuration)

### config/seo.php

[](#configseophp)

```
return [
    'mode' => 'manual',  // 'ai', 'manual', 'hybrid'

    'title.pattern' => '{title} | {site_name}',
    'title.site_name' => env('APP_NAME'),
    'title.max_length' => 60,

    'description.max_length' => 160,

    'ai.provider' => 'openai',
    'ai.api_key' => env('SEO_AI_API_KEY'),
    'ai.model' => 'gpt-4o-mini',
];
```

---

🤖 AI Providers
--------------

[](#-ai-providers)

```
use Intent\Seo\Config\SeoConfig;

// OpenAI
$config = new SeoConfig([
    'mode' => 'ai',
    'ai' => ['provider' => 'openai', 'api_key' => '...', 'model' => 'gpt-4o-mini'],
]);

// Anthropic Claude
$config = new SeoConfig([
    'ai' => ['provider' => 'anthropic', 'api_key' => '...', 'model' => 'claude-3-5-sonnet'],
]);

// Google Gemini
$config = new SeoConfig([
    'ai' => ['provider' => 'google', 'api_key' => '...', 'model' => 'gemini-1.5-flash'],
]);

// Local Ollama
$config = new SeoConfig([
    'ai' => ['provider' => 'ollama', 'api_url' => 'http://localhost:11434', 'model' => 'llama2'],
]);
```

---

📚 Documentation
---------------

[](#-documentation)

- [ARCHITECTURE.md](ARCHITECTURE.md) - Technical documentation
- [examples/routes.php](examples/routes.php) - Example routes
- [examples/views/](examples/views/) - Example Twig templates

---

🧪 Testing
---------

[](#-testing)

```
composer test              # Run tests
composer analyze           # PHPStan analysis
composer style             # Check code style
```

---

🙏 Credits
---------

[](#-credits)

This package is a fork of [php-seo](https://github.com/RumenDamyanov/php-seo) by **[Rumen Damyanov](https://github.com/RumenDamyanov)**.

**Please consider supporting the original author:**

- ⭐ [Star the original repository](https://github.com/RumenDamyanov/php-seo)
- 💝 [Sponsor Rumen Damyanov](https://github.com/sponsors/RumenDamyanov)

---

📄 License
---------

[](#-license)

[MIT License](LICENSE.md)

**Original Work:** Copyright (c) Rumen Damyanov
**Fork Modifications:** Copyright (c) Aamir Ali

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance83

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.3% of commits — single point of failure

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

Unknown

Total

1

Last Release

135d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d0e24a8ce7b47528ae71fa459cc6b7839a7cb0c3657002e78b929a7e4a58b93?d=identicon)[aamirali51](/maintainers/aamirali51)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (35 commits)")[![RumenDamyanov](https://avatars.githubusercontent.com/u/1458253?v=4)](https://github.com/RumenDamyanov "RumenDamyanov (21 commits)")[![aamirali51](https://avatars.githubusercontent.com/u/62554127?v=4)](https://github.com/aamirali51 "aamirali51 (4 commits)")

---

Tags

phpautomationopenaioptimizationseoclaudeAI-poweredmeta-tagsollamaintent-framework

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/intent-intent-seo/health.svg)

```
[![Health](https://phpackages.com/badges/intent-intent-seo/health.svg)](https://phpackages.com/packages/intent-intent-seo)
```

###  Alternatives

[rumenx/php-seo

AI-powered, framework-agnostic PHP package for automated SEO optimization. Intelligently generates meta tags, titles, descriptions, and alt texts using configurable AI providers or manual patterns.

102.0k](/packages/rumenx-php-seo)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6503.9M9](/packages/aporat-store-receipt-validator)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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