PHPackages                             shammaa/laravel-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. shammaa/laravel-seo

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

shammaa/laravel-seo
===================

Professional SEO package for Laravel with support for OpenGraph, Twitter Cards, LinkedIn, and Schema.org structured data

1.3.1(4mo ago)7502[1 issues](https://github.com/shammaa/laravel-seo/issues)MITPHPPHP ^8.1CI failing

Since Nov 18Pushed 4mo agoCompare

[ Source](https://github.com/shammaa/laravel-seo)[ Packagist](https://packagist.org/packages/shammaa/laravel-seo)[ RSS](/packages/shammaa-laravel-seo/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (6)Versions (30)Used By (0)

Laravel SEO Package
===================

[](#laravel-seo-package)

Professional SEO package for Laravel with comprehensive support for OpenGraph, Twitter Cards, LinkedIn, Schema.org structured data, multilingual SEO, performance optimization, analytics integration, and much more.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Configuration](#configuration)
- [Quick Start](#quick-start)
- [Usage Guide](#usage-guide)
- [Model Integration](#model-integration)
- [Complete Guide](#complete-guide) - **Full Controller &amp; Model Examples**
- [Advanced Features](#advanced-features)
- [Configuration Reference](#configuration-reference)
- [API Reference](#api-reference)
- [Examples](#examples)
- [Troubleshooting](#troubleshooting)
- [Best Practices](#best-practices)
- [Requirements](#requirements)
- [License](#license)

Features
--------

[](#features)

### Core SEO Features

[](#core-seo-features)

- ✅ **Meta Tags** - Title, Description, Keywords, Robots, Canonical
- ✅ **OpenGraph Tags** - Complete Facebook sharing support
- ✅ **Twitter Cards** - Summary and large image cards with reading time
- ✅ **LinkedIn Cards** - OpenGraph compatible
- ✅ **Article Tags** - Automatic article:tag generation from model relationships

### Schema.org Structured Data (JSON-LD) - 22+ Types

[](#schemaorg-structured-data-json-ld---22-types)

**Core Schemas:**

- ✅ **NewsArticle** - For blog posts and articles with author, publisher, dates
- ✅ **Product** - For e-commerce products with price, offers, ratings, shipping
- ✅ **Offer** - Enhanced with shipping details and return policy
- ✅ **AggregateRating** - For product ratings from multiple reviews
- ✅ **Brand** - For product brands
- ✅ **WebPage** - For all page types
- ✅ **BreadcrumbList** - Automatic breadcrumb navigation
- ✅ **VideoObject** - Enhanced with duration, contentUrl, interaction statistics
- ✅ **WebSite** - For homepage with search action
- ✅ **Organization** - Complete organization schema
- ✅ **CollectionPage** - For category pages
- ✅ **FAQPage** - For articles with frequently asked questions
- ✅ **HowTo** - For tutorial and instructional articles
- ✅ **Review** - For product and service reviews with ratings
- ✅ **Event** - For event announcements and coverage

**New Advanced Schemas:**

- ✅ **Course** - For educational courses with provider, instances, ratings
- ✅ **Recipe** - For recipes with ingredients, instructions, nutrition info
- ✅ **JobPosting** - For job listings with salary, location, requirements
- ✅ **LocalBusiness** - For local businesses with address, geo, hours
- ✅ **SoftwareApplication** - For apps with ratings, OS, pricing
- ✅ **Book** - For books with ISBN, author, publisher
- ✅ **Movie** - For movies with cast, director, ratings
- ✅ **Podcast** - For podcasts with episodes, author, publisher

### Advanced Features

[](#advanced-features)

- ✅ **Multilingual Support** - Hreflang tags for multiple languages
- ✅ **Reading Time** - Automatic calculation and display in Twitter Cards and Schema
- ✅ **AMP Support** - Automatic AMP link generation
- ✅ **RSS/Atom Feeds** - Feed link support
- ✅ **Pagination** - Prev/Next link support
- ✅ **Performance Optimization** - DNS Prefetch, Preconnect, Preload, Prefetch, Prerender, Modulepreload
- ✅ **Mobile Optimization** - Theme color, Apple mobile web app, manifest
- ✅ **Security Headers** - CSP, Referrer Policy, X-Frame-Options
- ✅ **Analytics Integration** - Google Analytics 4, GTM, Yandex Metrica, Facebook Pixel
- ✅ **Image Optimization** - Lazy loading configuration support
- ✅ **Geo-targeting** - Geographic meta tags for location-based SEO
- ✅ **Social Media** - Pinterest Rich Pins, WhatsApp, Telegram optimization
- ✅ **Commands** - `seo:test-schema` and `seo:health-check` for validation

### Developer Experience

[](#developer-experience)

- ✅ **Easy Facade API** - Simple, fluent interface
- ✅ **Fully Configurable** - Comprehensive config file
- ✅ **Automatic Detection** - Smart model attribute detection
- ✅ **Model Trait** - Automatic SEO data extraction from models
- ✅ **Extensible** - Easy to add custom schemas

Installation
------------

[](#installation)

### Install via Composer

[](#install-via-composer)

```
composer require shammaa/laravel-seo
```

**That's it!** The package will be installed automatically.

### Publish Configuration

[](#publish-configuration)

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

This creates `config/seo.php` where you can configure all SEO settings.

### Step 4: Configure Basic Settings

[](#step-4-configure-basic-settings)

Edit `config/seo.php` and set your site information:

```
'site' => [
    'name' => 'Your Site Name',
    'description' => 'Your site description',
    'url' => 'https://yoursite.com',
    'logo' => 'path/to/logo.jpg',
],
```

### Dynamic Site Data from Database (Recommended)

[](#dynamic-site-data-from-database-recommended)

Instead of hardcoding site information in the config file, you can load it dynamically from your database. This is useful when:

- You have a CMS with editable site settings
- You need to change site name/description without deploying
- You want to include social media links dynamically

**Step 1: Register the resolver in your Service Provider:**

```
use Shammaa\LaravelSEO\Services\SEOService;

// In AppServiceProvider or a dedicated SEOServiceProvider
public function boot(): void
{
    SEOService::setSiteDataResolver(function () {
        $settings = cache()->remember('site_settings', 86400, function () {
            return \App\Models\Setting::first();
        });

        return [
            'name' => $settings->site_name ?? config('app.name'),
            'description' => $settings->site_description ?? '',
            'logo' => $settings->site_logo ?? null,
            'publisher' => $settings->publisher_name ?? $settings->site_name,
            // Social media links for sameAs in Organization schema
            'same_as' => array_filter([
                $settings->facebook_url,
                $settings->twitter_url,
                $settings->instagram_url,
                $settings->youtube_url,
                $settings->linkedin_url,
                $settings->telegram_url,
            ]),
        ];
    });
}
```

**Step 2: The resolver data automatically:**

- ✅ Overrides config values
- ✅ Populates `og:site_name`, `publisher`, `author`
- ✅ Adds `sameAs` links to Organization and NewsArticle schemas
- ✅ Is cached for performance (configurable TTL)

**Clearing cache after settings update:**

```
// In your Settings controller after update:
cache()->forget('site_settings');
cache()->forget('seo_site_data_' . app()->getLocale());
```

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

[](#quick-start)

### Basic Usage

[](#basic-usage)

In your controller:

```
use Shammaa\LaravelSEO\Facades\SEO;

public function show(Post $post)
{
    SEO::post($post)->set();
    return view('post.show', compact('post'));
}
```

In your Blade layout (`resources/views/layouts/app.blade.php`):

```

    {!! SEO::render() !!}
    {!! $customSchemas ?? '' !!}

```

**That's it!** The package automatically generates all SEO tags.

Usage Guide
-----------

[](#usage-guide)

### Page Types

[](#page-types)

#### Home Page

[](#home-page)

```
public function index()
{
    SEO::home()->set();
    return view('home');
}
```

#### Post/Article Page

[](#postarticle-page)

```
public function show(Post $post)
{
    SEO::post($post)->set();
    return view('post.show', compact('post'));
}
```

#### Category Page

[](#category-page)

```
public function show(Category $category)
{
    SEO::category($category)->set();
    return view('category.show', compact('category'));
}
```

#### Product Page (E-commerce)

[](#product-page-e-commerce)

```
public function show(Product $product)
{
    SEO::product($product)->set();
    return view('product.show', compact('product'));
}
```

**Product Schema automatically includes:**

- Product name, description, images
- SKU, MPN, GTIN
- Brand information
- Price and offers
- Availability status
- Aggregate ratings (from reviews)
- Product properties (color, size, material, etc.)

#### Search Page

[](#search-page)

```
public function search(Request $request)
{
    SEO::search(['query' => $request->get('q')])->set();
    return view('search.results');
}
```

#### Tag Page

[](#tag-page)

```
public function show(Tag $tag)
{
    SEO::tag($tag)->set();
    return view('tag.show', compact('tag'));
}
```

#### Author Page

[](#author-page)

```
public function show(Author $author)
{
    SEO::author($author)->set();
    return view('author.show', compact('author'));
}
```

#### Archive Page

[](#archive-page)

```
public function archive(string $date)
{
    SEO::archive($date)->set();
    return view('archive.show', compact('date'));
}
```

#### Static Page

[](#static-page)

```
public function show(Page $page)
{
    SEO::page($page)->set();
    return view('page.show', compact('page'));
}
```

#### Custom Page Type

[](#custom-page-type)

```
public function show(CustomModel $model)
{
    SEO::for('custom', $model)->set();
    return view('custom.show', compact('model'));
}
```

### Author Handling

[](#author-handling)

The package automatically detects the author from your model relationships. It checks for relationships named: `writer`, `author`, `user`, or `creator`.

If the relationship is found, it will generate a rich **Person** schema with the author's name, image, and URL, instead of the generic Organization schema.

#### Manually Setting Author (`withAuthor`)

[](#manually-setting-author-withauthor)

If you need to manually specify the author, or override the author's URL/Image without verifying model methods, you can use `withAuthor()` with extra arguments:

```
public function show(Post $post)
{
    // 1. Just set the author model (Auto-detects URL/Image)
    SEO::post($post)->withAuthor($user)->set();

    // 2. Override Author URL and Image Field Name
    SEO::post($post)
        ->withAuthor(
            $user,
            url: 'https://mysite.com/authors/custom-url', // Custom URL
            image: 'avatar_url' // Custom image field name in User model
        )
        ->set();

    // 3. Override Author URL and Image URL directly
    SEO::post($post)
        ->withAuthor(
            $user,
            url: 'https://mysite.com/authors/me',
            image: 'https://mysite.com/images/me.jpg' // Direct Image URL
        )
    // 4. Use Route Name (Recommended)
    // Automatically calls route('authors.show', $user)
    SEO::post($post)
        ->withAuthor($user, 'authors.show')
        ->set();

    return view('post.show', compact('post'));
}
```

### Advanced Schema Usage

[](#advanced-schema-usage)

#### Video Schema

[](#video-schema)

For pages containing a main video:

```
SEO::post($post)->set()->addVideo([
    'video_url' => 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
    'title' => 'My Video Title', // Optional, defaults to page title
    'description' => 'Video description', // Optional, defaults to page description
    'image' => 'https://example.com/thumb.jpg', // Optional, defaults to page image
    'uploadDate' => '2024-01-01', // Optional
]);
```

**Automatic Detection:**If your model has a `video_url` attribute or accessor, the package automatically adds the Video Schema.

```
// In Post Model
public function getVideoUrlAttribute()
{
    // Return Youtube/Vimeo URL
    return $this->meta['video_link'] ?? null;
}
```

#### FAQ Schema

[](#faq-schema)

For articles with frequently asked questions:

```
SEO::post($article)->set()->addFAQ([
    [
        'question' => 'What is this about?',
        'answer' => 'This article explains...'
    ],
    [
        'question' => 'How does it work?',
        'answer' => 'It works by...'
    ],
]);
```

**From Database (with HasSEO trait):**

```
// In your Model
class Post extends Model
{
    use HasSEO;

    public function faqs()
    {
        return $this->hasMany(FAQ::class);
    }
}

// In Controller - Automatic!
SEO::post($post)->set(); // Automatically detects and adds FAQs
```

#### HowTo Schema

[](#howto-schema)

For tutorial and instructional articles:

**Simple Steps:**

```
SEO::post($tutorial)->set()->addHowTo(
    name: 'How to Cook Kabsa',
    steps: [
        'Wash the rice thoroughly',
        'Cook the meat with spices',
        'Mix rice with meat',
        'Cook on low heat for 30 minutes'
    ],
    description: 'A simple guide to cooking traditional Kabsa',
    image: '/images/kabsa.jpg'
);
```

**Detailed Steps:**

```
SEO::post($tutorial)->set()->addHowTo(
    name: 'How to Build a Website',
    steps: [
        [
            'name' => 'Choose a Domain',
            'text' => 'Select and register your domain name',
            'image' => '/images/step1.jpg',
            'url' => '/steps/1'
        ],
        [
            'name' => 'Set Up Hosting',
            'text' => 'Choose a hosting provider and set up your account',
            'image' => '/images/step2.jpg'
        ],
    ]
);
```

**From Database (with HasSEO trait):**

```
// In your Model
class Post extends Model
{
    use HasSEO;

    public function steps()
    {
        return $this->hasMany(TutorialStep::class)->orderBy('order');
    }
}

// In Controller - Automatic!
SEO::post($post)->set(); // Automatically detects and adds HowTo steps
```

#### Review Schema

[](#review-schema)

For product and service reviews:

```
SEO::post($review)->set()->addReview(
    itemName: 'iPhone 15',
    ratingValue: 4.5,
    bestRating: 5.0,
    reviewBody: 'A comprehensive review of the iPhone 15...',
    authorName: 'John Doe',
    datePublished: '2024-01-15'
);
```

**From Database (with HasSEO trait):**

```
// In your Model
class Post extends Model
{
    use HasSEO;

    public function review()
    {
        return $this->hasOne(Review::class);
    }
}

// In Controller - Automatic!
SEO::post($post)->set(); // Automatically detects and adds Review
```

#### Event Schema

[](#event-schema)

For event announcements and coverage:

```
SEO::post($event)->set()->addEvent(
    name: 'Tech Conference 2024',
    startDate: '2024-01-15T10:00:00+00:00',
    endDate: '2024-01-15T18:00:00+00:00',
    description: 'A major technology conference...',
    locationName: 'Conference Hall',
    locationAddress: 'Damascus, Syria',
    image: '/images/conference.jpg',
    organizerName: 'Tech Company',
    organizerUrl: 'https://tech-company.com'
);
```

**From Database (with HasSEO trait):**

```
// In your Model
class Post extends Model
{
    use HasSEO;

    public function event()
    {
        return $this->hasOne(Event::class);
    }
}

// In Controller - Automatic!
SEO::post($post)->set(); // Automatically detects and adds Event
```

### Breadcrumb Usage

[](#breadcrumb-usage)

The breadcrumb is automatically generated for `post` and `category` page types.

#### Method 1: Using the shared variable (Automatic)

[](#method-1-using-the-shared-variable-automatic)

After calling `SEO::set()`, breadcrumb items are automatically shared with the view:

```
@if(isset($breadcrumbs))
    @include('seo::breadcrumb')
@endif
```

#### Method 2: Using the Facade method

[](#method-2-using-the-facade-method)

```
@php
    $breadcrumbs = SEO::post($post)->breadcrumb();
@endphp

@foreach($breadcrumbs as $item)
    @if(isset($item['item']) && !$loop->last)
        {{ $item['name'] }}
    @else
        {{ $item['name'] }}
    @endif
    @if(!$loop->last) / @endif
@endforeach
```

#### Method 3: Using the included view component

[](#method-3-using-the-included-view-component)

```
@include('seo::breadcrumb', [
    'separator' => ' / ',
    'class' => 'breadcrumb',
    'itemClass' => 'breadcrumb-item'
])
```

The breadcrumb view includes Schema.org microdata for SEO.

### Chaining Multiple Schemas

[](#chaining-multiple-schemas)

You can chain multiple schema types for a single page:

```
SEO::post($article)
    ->set()
    ->addFAQ([...])
    ->addHowTo(...)
    ->addReview(...)
    ->addEvent(...);
```

New Advanced Schemas - Complete Guide
-------------------------------------

[](#new-advanced-schemas---complete-guide)

### Course Schema

[](#course-schema)

Perfect for educational websites, online courses, and training platforms:

```
SEO::addCourse([
    'name' => 'Laravel Advanced Techniques',
    'description' => 'Learn advanced Laravel concepts and best practices',
    'provider' => [
        'name' => 'Tech Academy',
        'url' => 'https://tech-academy.com'
    ],
    'courseCode' => 'LAR-201',
    'educationalLevel' => 'Advanced',
    'inLanguage' => 'ar',
    'image' => '/images/course.jpg',
    'hasCourseInstance' => [
        'startDate' => '2024-02-01',
        'endDate' => '2024-04-30',
        'courseMode' => 'online',
        'instructor' => [
            'name' => 'Ahmed Ali',
            'email' => 'ahmed@example.com'
        ],
        'location' => 'Online Platform'
    ],
    'aggregateRating' => [
        'ratingValue' => 4.8,
        'ratingCount' => 150
    ]
]);
```

### Recipe Schema

[](#recipe-schema)

Ideal for food blogs, recipe websites, and cooking platforms:

```
SEO::addRecipe([
    'name' => 'Traditional Kabsa',
    'description' => 'Authentic Saudi Kabsa recipe with step-by-step instructions',
    'image' => '/images/kabsa.jpg',
    'prepTime' => 'PT30M', // ISO 8601 duration format
    'cookTime' => 'PT1H',
    'totalTime' => 'PT1H30M',
    'recipeYield' => '6 servings',
    'recipeCategory' => 'Main Course',
    'recipeCuisine' => 'Saudi',
    'recipeIngredient' => [
        '2 cups basmati rice',
        '1 kg chicken',
        'Kabsa spices',
        'Onions and tomatoes'
    ],
    'recipeInstructions' => [
        'Wash and soak rice for 30 minutes',
        'Cook chicken with spices',
        'Add rice and cook on low heat',
        'Serve hot with salad'
    ],
    'author' => 'Chef Fatima',
    'datePublished' => '2024-01-15',
    'nutrition' => [
        'calories' => '450',
        'fatContent' => '15g',
        'proteinContent' => '30g',
        'carbohydrateContent' => '50g'
    ],
    'aggregateRating' => [
        'ratingValue' => 4.9,
        'ratingCount' => 89
    ]
]);
```

### JobPosting Schema

[](#jobposting-schema)

Perfect for job boards and recruitment websites:

```
SEO::addJobPosting([
    'title' => 'Senior Laravel Developer',
    'description' => 'We are looking for an experienced Laravel developer...',
    'datePosted' => '2024-01-15',
    'validThrough' => '2024-03-15',
    'employmentType' => ['FULL_TIME', 'CONTRACTOR'],
    'hiringOrganization' => [
        'name' => 'Tech Company',
        'sameAs' => 'https://tech-company.com',
        'logo' => 'https://tech-company.com/logo.png'
    ],
    'jobLocation' => [
        'address' => [
            'streetAddress' => '123 Main Street',
            'addressLocality' => 'Damascus',
            'addressRegion' => 'Damascus',
            'postalCode' => '12345',
            'addressCountry' => 'SY'
        ]
    ],
    'baseSalary' => [
        'currency' => 'USD',
        'value' => [
            'minValue' => 50000,
            'maxValue' => 80000
        ]
    ],
    'jobBenefits' => ['Health Insurance', 'Remote Work', 'Flexible Hours'],
    'qualifications' => [
        'Bachelor\'s degree in Computer Science',
        '5+ years Laravel experience'
    ],
    'skills' => ['Laravel', 'PHP', 'MySQL', 'Vue.js']
]);
```

### LocalBusiness Schema

[](#localbusiness-schema)

Great for local businesses, restaurants, shops, and service providers:

```
SEO::addLocalBusiness([
    'businessType' => 'Restaurant', // or 'LocalBusiness', 'Store', etc.
    'name' => 'Al-Sham Restaurant',
    'description' => 'Authentic Syrian cuisine in the heart of Damascus',
    'address' => [
        'streetAddress' => 'Al-Maliki Street',
        'addressLocality' => 'Damascus',
        'addressRegion' => 'Damascus',
        'postalCode' => '12345',
        'addressCountry' => 'SY'
    ],
    'geo' => [
        'latitude' => 33.5138,
        'longitude' => 36.2765
    ],
    'telephone' => '+963-11-1234567',
    'email' => 'info@alsham-restaurant.com',
    'url' => 'https://alsham-restaurant.com',
    'logo' => '/images/logo.png',
    'image' => ['/images/interior1.jpg', '/images/interior2.jpg'],
    'openingHours' => [
        'Mo-Fr 10:00-22:00',
        'Sa-Su 12:00-23:00'
    ],
    'priceRange' => '$$',
    'paymentAccepted' => ['Cash', 'Credit Card', 'Mobile Payment'],
    'servesCuisine' => ['Syrian', 'Middle Eastern'],
    'menu' => 'https://alsham-restaurant.com/menu',
    'aggregateRating' => [
        'ratingValue' => 4.7,
        'ratingCount' => 234
    ]
]);
```

### SoftwareApplication Schema

[](#softwareapplication-schema)

Perfect for app stores, software marketplaces, and SaaS platforms:

```
SEO::addSoftwareApplication([
    'name' => 'My Awesome App',
    'description' => 'A productivity app that helps you organize your tasks',
    'applicationCategory' => 'ProductivityApplication',
    'operatingSystem' => ['Android', 'iOS'],
    'offers' => [
        'price' => '0',
        'priceCurrency' => 'USD',
        'availability' => 'https://schema.org/InStock'
    ],
    'aggregateRating' => [
        'ratingValue' => 4.5,
        'ratingCount' => 1250
    ],
    'screenshot' => [
        '/images/screenshot1.png',
        '/images/screenshot2.png'
    ],
    'image' => '/images/app-icon.png',
    'url' => 'https://myapp.com',
    'softwareVersion' => '2.1.0',
    'datePublished' => '2023-01-01'
]);
```

### Book Schema

[](#book-schema)

Ideal for bookstores, libraries, and publishing websites:

```
SEO::addBook([
    'name' => 'The Art of Laravel',
    'description' => 'A comprehensive guide to Laravel framework',
    'author' => [
        ['name' => 'John Doe'],
        ['name' => 'Jane Smith']
    ],
    'isbn' => '978-0-123456-78-9',
    'datePublished' => '2024-01-01',
    'publisher' => [
        'name' => 'Tech Books Publishing',
        'url' => 'https://techbooks.com'
    ],
    'bookFormat' => 'Hardcover',
    'numberOfPages' => 350,
    'image' => '/images/book-cover.jpg',
    'url' => 'https://example.com/book',
    'inLanguage' => 'en',
    'genre' => ['Technology', 'Programming']
]);
```

### Movie Schema

[](#movie-schema)

Perfect for movie databases, streaming platforms, and entertainment sites:

```
SEO::addMovie([
    'name' => 'The Great Adventure',
    'description' => 'An epic journey through time and space',
    'image' => '/images/movie-poster.jpg',
    'datePublished' => '2024-01-15',
    'director' => [
        ['name' => 'Director Name']
    ],
    'actor' => [
        ['name' => 'Actor One'],
        ['name' => 'Actor Two']
    ],
    'genre' => ['Action', 'Adventure', 'Sci-Fi'],
    'duration' => 'PT2H30M',
    'aggregateRating' => [
        'ratingValue' => 8.5,
        'ratingCount' => 5000,
        'bestRating' => 10.0
    ],
    'contentRating' => 'PG-13',
    'productionCompany' => [
        ['name' => 'Production Company']
    ],
    'countryOfOrigin' => ['US'],
    'inLanguage' => ['en', 'ar']
]);
```

### Podcast Schema

[](#podcast-schema)

Great for podcast platforms and audio content websites:

```
SEO::addPodcast([
    'name' => 'Tech Talk Podcast',
    'description' => 'Weekly discussions about technology and innovation',
    'image' => '/images/podcast-cover.jpg',
    'author' => [
        'name' => 'Podcast Host',
        'email' => 'host@example.com'
    ],
    'publisher' => [
        'name' => 'Podcast Network',
        'url' => 'https://podcast-network.com'
    ],
    'url' => 'https://example.com/podcast',
    'inLanguage' => 'ar',
    'category' => ['Technology', 'Business'],
    'episode' => [
        'name' => 'Episode 1: Getting Started',
        'description' => 'In this episode, we discuss...',
        'datePublished' => '2024-01-15',
        'duration' => 'PT30M',
        'episodeNumber' => 1
    ],
    'aggregateRating' => [
        'ratingValue' => 4.6,
        'ratingCount' => 120
    ]
]);
```

### Enhanced Video Schema

[](#enhanced-video-schema)

Improved VideoObject with additional features:

```
SEO::addVideo([
    'name' => 'Tutorial Video',
    'description' => 'Learn how to use Laravel SEO package',
    'video_url' => 'https://youtube.com/watch?v=...',
    'image' => '/images/video-thumbnail.jpg',
    'duration' => 'PT15M30S',
    'contentUrl' => 'https://example.com/video.mp4',
    'uploadDate' => '2024-01-15',
    'interactionStatistic' => [
        [
            '@type' => 'InteractionCounter',
            'interactionType' => 'https://schema.org/WatchAction',
            'userInteractionCount' => 10000
        ],
        [
            '@type' => 'InteractionCounter',
            'interactionType' => 'https://schema.org/LikeAction',
            'userInteractionCount' => 500
        ]
    ]
]);
```

Geo-targeting
-------------

[](#geo-targeting)

Add geographic targeting meta tags for location-based SEO:

```
// In config/seo.php
'geo_targeting' => [
    'enabled' => true,
    'country' => 'SY',
    'region' => 'SY-DI', // Damascus
    'placename' => 'Damascus',
    'latitude' => 33.5138,
    'longitude' => 36.2765,
],
```

This automatically generates:

- `geo.region` meta tag
- `geo.placename` meta tag
- `geo.position` meta tag
- `ICBM` meta tag

Social Media Optimization
-------------------------

[](#social-media-optimization)

### Pinterest Rich Pins

[](#pinterest-rich-pins)

```
// In config/seo.php
'social' => [
    'pinterest' => [
        'verify' => 'your-pinterest-verification-code',
    ],
],
```

### WhatsApp &amp; Telegram

[](#whatsapp--telegram)

Both WhatsApp and Telegram use OpenGraph tags, so they work automatically. The package optimizes images for better previews.

Performance Optimization (Enhanced)
-----------------------------------

[](#performance-optimization-enhanced)

### Prefetch, Prerender, and Modulepreload

[](#prefetch-prerender-and-modulepreload)

```
// In config/seo.php
'performance' => [
    'prefetch' => [
        '/next-page',
        '/related-article',
    ],
    'prerender' => [
        '/important-page',
    ],
    'modulepreload' => [
        [
            'href' => '/js/app.js',
            'type' => 'module',
        ],
    ],
    'preload' => [
        [
            'href' => '/css/critical.css',
            'as' => 'style',
            'onload' => "this.onload=null;this.rel='stylesheet'", // Critical CSS
        ],
    ],
],
```

Commands
--------

[](#commands)

### Test Schema

[](#test-schema)

Test your JSON-LD schemas:

```
php artisan seo:test-schema
php artisan seo:test-schema https://example.com
php artisan seo:test-schema --format=table
```

This command:

- Fetches the page HTML
- Extracts all JSON-LD schemas
- Validates JSON structure
- Displays schema types and status

### Health Check

[](#health-check)

Check your SEO configuration:

```
php artisan seo:health-check
```

This command checks:

- ✅ Site configuration (name, description, URL)
- ✅ Social media settings (Twitter, Facebook)
- ✅ Analytics setup (GA4, GTM)
- ✅ Multilingual configuration
- ✅ Organization schema
- ✅ Provides a health score (0-100%)

Complete Guide
--------------

[](#complete-guide)

For complete examples of Controller and Model integration for all page types, see:

- **[COMPLETE\_GUIDE.md](COMPLETE_GUIDE.md)** - Comprehensive guide with explanations
- **[EXAMPLES\_TEST.md](EXAMPLES_TEST.md)** - Ready-to-use code examples you can copy and paste

These guides include:

- ✅ Full Model examples for all page types
- ✅ Full Controller examples
- ✅ Migration examples
- ✅ Route examples
- ✅ View examples
- ✅ What gets generated automatically
- ✅ Advanced examples
- ✅ View integration
- ✅ Best practices
- ✅ Troubleshooting
- ✅ Testing checklist

Model Integration
-----------------

[](#model-integration)

The package provides a professional `HasSEO` trait that automatically detects and extracts SEO data from your models.

### Quick Setup

[](#quick-setup)

#### Step 1: Add Trait to Model

[](#step-1-add-trait-to-model)

```
