PHPackages                             artisanpack-ui/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. artisanpack-ui/seo

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

artisanpack-ui/seo
==================

SEO utilities and meta tag management for Laravel applications

1.3.0(3w ago)0408[6 issues](https://github.com/ArtisanPack-UI/seo/issues)MITPHPPHP ^8.2CI passing

Since Jan 18Pushed 3w agoCompare

[ Source](https://github.com/ArtisanPack-UI/seo)[ Packagist](https://packagist.org/packages/artisanpack-ui/seo)[ RSS](/packages/artisanpack-ui-seo/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (6)Dependencies (58)Versions (9)Used By (0)

ArtisanPack UI SEO
==================

[](#artisanpack-ui-seo)

ArtisanPack UI SEO is a comprehensive SEO management package for Laravel applications. Built on Livewire 3, it provides complete control over meta tags, Open Graph, Twitter Cards, Schema.org markup, XML sitemaps, URL redirects, robots.txt generation, and SEO content analysis.

Quick Start
-----------

[](#quick-start)

### Installation

[](#installation)

```
# Install the package
composer require artisanpack-ui/seo

# Run migrations
php artisan migrate

# Publish configuration (optional)
php artisan vendor:publish --tag=seo-config
```

### Basic Usage

[](#basic-usage)

```
// Add the HasSeo trait to your model
use ArtisanPackUI\Seo\Traits\HasSeo;

class Post extends Model
{
    use HasSeo;
}
```

```

```

Key Features
------------

[](#key-features)

- **Meta Tag Management**: Title, description, robots directives, and canonical URLs with automatic fallbacks
- **Social Media Tags**: Open Graph for Facebook/LinkedIn and Twitter Cards with image support
- **Schema.org Markup**: 14 built-in JSON-LD schema types for rich search results
- **Multi-Language Support**: Hreflang tags for international SEO
- **URL Redirects**: Exact, regex, and wildcard redirects with hit tracking
- **XML Sitemaps**: Standard, image, video, and news sitemaps with automatic indexing
- **Dynamic Robots.txt**: Configurable rules with bot-specific directives
- **SEO Analysis**: 8 built-in analyzers for content quality scoring
- **Performance Caching**: Comprehensive caching for meta tags, sitemaps, and redirects
- **Admin Components**: Livewire components for visual SEO management
- **AI Features**: Five AI agents for title/description suggestions, content analysis, schema generation, and hreflang gap detection (requires `artisanpack-ui/ai`)

Components
----------

[](#components)

### Blade Components

[](#blade-components)

ComponentPurpose``All-in-one SEO output (meta, OG, Twitter, schema)``Basic meta tags only``Open Graph tags for social sharing``Twitter Card meta tags``Schema.org JSON-LD markup``Hreflang link tags for multi-language### Livewire Components

[](#livewire-components)

ComponentPurpose``Full SEO editing interface with tabs``URL redirect management``SEO overview and statistics``Content analysis results``Multi-language URL editor``Search result preview``Social share preview``AI-generated title variants``AI-generated meta description``AI content quality scoring with recommendations``AI JSON-LD schema type suggestion + starter object``AI hreflang gap detection### Schema Types

[](#schema-types)

Article, BlogPosting, Product, Organization, Person, LocalBusiness, Event, Recipe, FAQPage, HowTo, BreadcrumbList, WebSite, WebPage, VideoObject

AI Features
-----------

[](#ai-features)

Five agents are shipped for use with the `artisanpack-ui/ai` foundation package. When `artisanpack-ui/ai` is installed and configured with credentials, the SEO service provider auto-registers each feature via `aiFeatures()`.

Feature keyDefault modelDescription`seo.suggest_meta_title``claude-haiku-4-5`Generate 3-5 SEO title variants (≤60 chars).`seo.suggest_meta_description``claude-haiku-4-5`Generate one 150-160 character meta description.`seo.analyze_content``claude-sonnet-4-6`Score content across keyword usage, readability, structure, and semantic completeness.`seo.generate_schema``claude-haiku-4-5`Pick a JSON-LD schema type from the supported list and produce a starter object.`seo.suggest_hreflang``claude-haiku-4-5`Cross-reference hreflang tags and surface missing or inconsistent relationships.### Trigger surfaces

[](#trigger-surfaces)

Every feature ships trigger UI on all three supported frontends:

- **Livewire** — the components listed above. Drop them into your editor views.
- **React** — `MetaTitleSuggestor`, `MetaDescriptionSuggestor`, `ContentAnalyzer`, `SchemaSuggestor`, `HreflangSuggestor` under `@artisanpack-ui/seo/react` (or the published path). Backed by the `useAiAgent` hook.
- **Vue** — the same five components under `@artisanpack-ui/seo/vue`, backed by the `useAiAgent` composable.

React and Vue triggers call the JSON API at `/api/seo/ai/{feature}` — see the routes registered under `Route::prefix('ai')` in `routes/api.php` (`suggest-meta-title`, `suggest-meta-description`, `analyze-content`, `generate-schema`, `suggest-hreflang`).

### Feature toggles

[](#feature-toggles)

Each feature honors the shared registry toggle. A disabled feature returns a `FeatureDisabledException` from the agent and a `409` from the API. Toggle at runtime via the `FeatureRegistry` facade:

```
use ArtisanPackUI\Ai\Contracts\FeatureRegistry;

app( FeatureRegistry::class )->disable( 'seo.analyze_content' );
```

Or set the initial state in `config/artisanpack.php`:

```
'ai' => [
    'features' => [
        'seo.suggest_meta_title' => [ 'enabled' => true, 'model' => 'claude-haiku-4-5' ],
        // ...
    ],
],
```

Documentation
-------------

[](#documentation)

Comprehensive documentation is available at [docs.artisanpackui.dev](https://docs.artisanpackui.dev):

- **[Getting Started](https://docs.artisanpackui.dev/seo/getting-started)** - Quick start guide
- **[Installation](https://docs.artisanpackui.dev/seo/installation)** - Detailed setup instructions
- **[Configuration](https://docs.artisanpackui.dev/seo/installation/configuration)** - All configuration options
- **[Meta Tags](https://docs.artisanpackui.dev/seo/usage/meta-tags)** - Meta tag management
- **[Social Media](https://docs.artisanpackui.dev/seo/usage/social-media)** - Open Graph and Twitter Cards
- **[Schema.org](https://docs.artisanpackui.dev/seo/usage/schema)** - Structured data markup
- **[Components](https://docs.artisanpackui.dev/seo/components)** - Blade and Livewire components
- **[API Reference](https://docs.artisanpackui.dev/seo/api)** - Models, services, and events

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

[](#configuration)

Publish the configuration file:

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

### Key Configuration Options

[](#key-configuration-options)

```
// config/seo.php
return [
    // Site defaults
    'site' => [
        'name' => env('APP_NAME'),
        'separator' => ' | ',
    ],

    // Default meta values
    'defaults' => [
        'title' => null,
        'description' => null,
        'image' => null,
        'robots' => 'index, follow',
    ],

    // Feature toggles
    'redirects' => ['enabled' => true],
    'sitemap' => ['enabled' => true],
    'robots' => ['enabled' => true],
    'analysis' => ['enabled' => true],

    // Caching
    'cache' => [
        'enabled' => true,
        'driver' => null, // Uses default cache driver
        'ttl' => 3600,
    ],

    // Routes
    'routes' => [
        'sitemap' => true,
        'robots' => true,
    ],
];
```

### Environment Variables

[](#environment-variables)

VariableDescriptionDefault`SEO_SITE_NAME`Site name for titles`APP_NAME``SEO_TITLE_SEPARATOR`Separator between title and site name`|``SEO_DEFAULT_ROBOTS`Default robots directive`index, follow``SEO_CACHE_ENABLED`Enable SEO caching`true``SEO_CACHE_TTL`Cache TTL in seconds`3600``SEO_REDIRECTS_ENABLED`Enable redirect handling`true``SEO_SITEMAP_ENABLED`Enable sitemap generation`true``SEO_ANALYSIS_ENABLED`Enable SEO analysis`true`Artisan Commands
----------------

[](#artisan-commands)

```
# Generate XML sitemap
php artisan seo:generate-sitemap

# Submit sitemap to search engines
php artisan seo:submit-sitemap

# Clear SEO cache
php artisan seo:clear-cache
```

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

[](#requirements)

- PHP 8.2 or higher
- Laravel 10, 11, 12, or 13
- Livewire 3.6+

Dependencies
------------

[](#dependencies)

This package integrates with the ArtisanPack UI ecosystem:

- [artisanpack-ui/core](https://github.com/ArtisanPack-UI/core) - Core utilities
- [artisanpack-ui/livewire-ui-components](https://github.com/ArtisanPack-UI/livewire-ui-components) - UI components
- [artisanpack-ui/hooks](https://github.com/ArtisanPack-UI/hooks) - WordPress-style hooks for extensibility

Events
------

[](#events)

The package dispatches events for key actions:

```
use ArtisanPackUI\Seo\Events\SeoMetaCreated;
use ArtisanPackUI\Seo\Events\SeoMetaUpdated;
use ArtisanPackUI\Seo\Events\SitemapGenerated;
use ArtisanPackUI\Seo\Events\RedirectHit;

// Listen for SEO meta changes
Event::listen(SeoMetaUpdated::class, function ($event) {
    // $event->seoMeta contains the updated meta
    // $event->model contains the associated model
});

// Listen for redirect hits
Event::listen(RedirectHit::class, function ($event) {
    // $event->redirect contains the redirect record
    // $event->request contains the HTTP request
});
```

Helper Functions
----------------

[](#helper-functions)

```
// Get the SEO service
$seo = seo();

// Get SEO meta for a model
$meta = seoMeta($post);

// Format a page title with site name
$title = seoTitle('My Page'); // "My Page | Site Name"

// Truncate description to SEO length
$desc = seoDescription($longText); // Truncated to 160 chars

// Check if a feature is enabled
if (seoIsEnabled('sitemap')) {
    // Generate sitemap
}

// Get configuration value
$separator = seoConfig('site.separator');
```

Extensibility
-------------

[](#extensibility)

### Custom Schema Types

[](#custom-schema-types)

```
use ArtisanPackUI\Seo\Contracts\SchemaBuilderInterface;

class CustomSchemaBuilder implements SchemaBuilderInterface
{
    public function build($model, array $data = []): array
    {
        return [
            '@context' => 'https://schema.org',
            '@type' => 'CustomType',
            // ... custom properties
        ];
    }
}

// Register via service provider
$this->app->bind('seo.schema.custom', CustomSchemaBuilder::class);
```

### Custom Analyzers

[](#custom-analyzers)

```
use ArtisanPackUI\Seo\Contracts\AnalyzerInterface;

class CustomAnalyzer implements AnalyzerInterface
{
    public function analyze($model): array
    {
        return [
            'score' => 85,
            'status' => 'good',
            'message' => 'Content passes custom analysis.',
            'suggestions' => [],
        ];
    }
}
```

### Filter Hooks

[](#filter-hooks)

The package fires the following filter hooks from the `artisanpack-ui/hooks` package:

HookFired inPayload`ap.seo.metaTags``MetaTagService::generate()``(array $tags, ?Model $subject, Request $request)``ap.seo.sitemapEntries``SitemapGenerator::generate()` and `generateFromProvider()``(array $entries, string $sitemapType)`It also subscribes to `ap.visualEditor.prePublishChecks` (fired by `artisanpack-ui/visual-editor`) to append SEO checks to the pre-publish workflow.

```
use function addFilter;

// Modify meta tags before the DTO is built
addFilter( 'ap.seo.metaTags', function ( array $tags, ?Model $subject, Request $request ): array {
    $tags['additionalMeta']['x-custom'] = 'Custom value';

    return $tags;
} );

// Add or remove sitemap entries per sitemap type
addFilter( 'ap.seo.sitemapEntries', function ( array $entries, string $sitemapType ): array {
    if ( 'page' === $sitemapType ) {
        $entries[] = [
            'url'        => 'https://example.com/extra',
            'lastmod'    => now()->toIso8601String(),
            'changefreq' => 'weekly',
            'priority'   => 0.6,
        ];
    }

    return $entries;
} );
```

Middleware
----------

[](#middleware)

Add the redirect middleware to handle URL redirects:

```
// In bootstrap/app.php
->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [
        \ArtisanPackUI\Seo\Http\Middleware\HandleRedirects::class,
    ]);
})
```

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

[](#contributing)

Contributions are welcome! To contribute:

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Merge Request

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting merge requests.

License
-------

[](#license)

ArtisanPack UI SEO is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance94

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Every ~44 days

Total

5

Last Release

27d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba2a2c40c9a93470595cd10701d2291434f3a7db61862d9700a9e69e31608c6c?d=identicon)[JacobMartellaWebDesign](/maintainers/JacobMartellaWebDesign)

---

Top Contributors

[![ViewFromTheBox](https://avatars.githubusercontent.com/u/8247489?v=4)](https://github.com/ViewFromTheBox "ViewFromTheBox (57 commits)")

---

Tags

laravellaravel-packagemeta-tagsopengraphphpschema-markupseositemap

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[illuminate/pipeline

The Illuminate Pipeline package.

9350.2M311](/packages/illuminate-pipeline)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)[aedart/athenaeum

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

265.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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