PHPackages                             ibrahim-eng12/seoquent - 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. ibrahim-eng12/seoquent

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

ibrahim-eng12/seoquent
======================

Seoquent - A powerful all-in-one Laravel SEO package. Meta tags, Open Graph, Twitter Cards, JSON-LD structured data, sitemap generation, robots.txt, and per-model SEO management.

v1.0(2mo ago)1461MITPHPPHP ^8.1

Since Feb 9Pushed 2mo agoCompare

[ Source](https://github.com/ibrahim-eng12/Seoquent)[ Packagist](https://packagist.org/packages/ibrahim-eng12/seoquent)[ RSS](/packages/ibrahim-eng12-seoquent/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Seoquent
========

[](#seoquent)

All-in-one SEO for Laravel 10+. One line in your controller, one directive in your blade — done.

The Problem
-----------

[](#the-problem)

SEO in Laravel is a mess. You end up with:

- Meta tags scattered across every Blade view
- Open Graph and Twitter Cards copy-pasted and forgotten
- No structured data (JSON-LD), so Google shows plain blue links instead of rich results
- Sitemap and robots.txt managed manually or with separate packages
- Every model needs its own SEO logic, duplicated everywhere

You spend more time wiring SEO tags than building your actual app.

The Solution
------------

[](#the-solution)

Seoquent handles **everything** from one place. Set your SEO in the controller, drop one directive in your layout — the package generates all the meta tags, Open Graph, Twitter Cards, JSON-LD, sitemap, and robots.txt automatically.

```
// Controller
Seo::title('My Post')->description('...')->image('...');
```

```

    @seoHead

```

That's it. No more scattered tags. No more forgetting Open Graph. No more missing structured data.

Features
--------

[](#features)

- **Meta Tags** — title, description, keywords, robots, canonical, author
- **Open Graph** — auto-generated from meta tags, fully customizable
- **Twitter Cards** — auto-generated from Open Graph, fully customizable
- **JSON-LD Structured Data** — Article, Product, FAQ, Breadcrumbs, Organization, LocalBusiness, and custom schemas
- **XML Sitemap** — auto-generated from static URLs and Eloquent models, cached, served at `/sitemap.xml`
- **Dynamic robots.txt** — configurable allow/disallow rules, served at `/robots.txt`
- **Per-Model SEO** — `HasSeo` trait to store and load SEO data from the database for any model
- **Blade Directives** — `@seoHead` and `@seoJsonLd`, zero config rendering
- **Smart Fallbacks** — Twitter falls back to Open Graph, Open Graph falls back to meta tags
- **Fluent API** — chainable, readable, easy to use
- **Laravel 10, 11, 12** — fully compatible

---

Install
-------

[](#install)

```
composer require ibrahim-eng12/seoquent
```

3 Steps to Full SEO
-------------------

[](#3-steps-to-full-seo)

### 1. Set SEO in your controller

[](#1-set-seo-in-your-controller)

```
use IbrahimEng12\Seoquent\Facades\Seo;

public function show(Post $post)
{
    Seo::title($post->title)
        ->description($post->excerpt)
        ->image($post->cover_image);

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

### 2. Add the directive to your layout

[](#2-add-the-directive-to-your-layout)

```

    @seoHead

```

### 3. That's it. This is what gets rendered:

[](#3-thats-it-this-is-what-gets-rendered)

```
My Post Title | App Name

```

All from 3 lines of code.

---

What's Included
---------------

[](#whats-included)

FeatureAuto-generatedRouteMeta tags (title, description, robots, canonical)Yes-Open Graph tagsYes (falls back to meta)-Twitter CardsYes (falls back to meta)-JSON-LD structured dataYes-XML SitemapYes`/sitemap.xml`Dynamic robots.txtYes`/robots.txt`Per-model SEO (database)Optional----

API Reference
-------------

[](#api-reference)

### Basic SEO

[](#basic-seo)

```
Seo::title('Page Title');
Seo::description('Page description');
Seo::keywords(['keyword1', 'keyword2']);
Seo::image('https://example.com/image.jpg');
Seo::canonical('https://example.com/page');
Seo::author('Ibrahim');
Seo::robots('index, follow');
Seo::noIndex();
```

All methods are chainable:

```
Seo::title('About Us')
    ->description('Learn more about our company')
    ->keywords('company, about, team')
    ->image('https://example.com/about.jpg')
    ->author('Ibrahim');
```

### Title Customization

[](#title-customization)

```
// Default output: "Page Title | App Name"
Seo::title('Page Title');

// Remove suffix: "Page Title"
Seo::meta()->withoutTitleSuffix();

// Change separator: "Page Title - App Name"
Seo::meta()->titleSeparator(' - ');
```

### Open Graph

[](#open-graph)

Falls back to your meta title/description automatically. Override when needed:

```
Seo::openGraph()
    ->title('Custom OG Title')
    ->description('Custom OG Description')
    ->type('article')
    ->image('https://example.com/og.jpg', 1200, 630, 'Alt text')
    ->siteName('My Site')
    ->locale('en_US');
```

### Twitter Cards

[](#twitter-cards)

Falls back to Open Graph, then meta tags. Override when needed:

```
Seo::twitter()
    ->card('summary_large_image')
    ->site('@mysite')
    ->creator('@author')
    ->title('Custom Twitter Title')
    ->image('https://example.com/twitter.jpg', 'Alt text');
```

### JSON-LD Structured Data

[](#json-ld-structured-data)

Add `@seoJsonLd` to your layout (before ``), then use any of these:

```
// Article
Seo::jsonLd()->article(
    title: 'My Article',
    author: 'Ibrahim',
    datePublished: '2025-01-01',
    dateModified: '2025-01-15',
    image: 'https://example.com/article.jpg',
);

// Organization
Seo::jsonLd()->organization('Company Name', 'https://example.com', 'https://example.com/logo.png');

// Breadcrumbs
Seo::jsonLd()->breadcrumbs([
    ['name' => 'Home', 'url' => '/'],
    ['name' => 'Blog', 'url' => '/blog'],
    ['name' => 'Current Post'],
]);

// FAQ
Seo::jsonLd()->faq([
    ['question' => 'What is this?', 'answer' => 'A Laravel SEO package.'],
    ['question' => 'Is it free?', 'answer' => 'Yes, MIT licensed.'],
]);

// Product
Seo::jsonLd()->product(
    name: 'Product Name',
    description: 'Description',
    brand: 'Brand',
    price: 29.99,
    currency: 'USD',
    availability: 'InStock',
);

// Local Business
Seo::jsonLd()->localBusiness(
    name: 'My Business',
    address: '123 Main St',
    phone: '+1234567890',
);

// Website with search action
Seo::jsonLd()->website('My Site', 'https://example.com', 'https://example.com/search?q=');

// Any custom schema
Seo::jsonLd()->addSchema([
    '@context' => 'https://schema.org',
    '@type' => 'Event',
    'name' => 'My Event',
    'startDate' => '2025-06-01',
]);
```

### XML Sitemap

[](#xml-sitemap)

Register URLs in a service provider's `boot()` method:

```
use IbrahimEng12\Seoquent\Facades\Seo;

// Static pages
Seo::sitemap()
    ->add(url('/'), now()->toIso8601String(), 'daily', 1.0)
    ->add(url('/about'), null, 'monthly', 0.8);

// From Eloquent models (auto-generates URLs)
Seo::sitemap()->addModel(
    modelClass: \App\Models\Post::class,
    routeName: 'posts.show',
    routeKey: 'slug',
    changefreq: 'weekly',
    priority: 0.8,
    queryCallback: fn ($query) => $query->where('published', true),
);
```

Served at `/sitemap.xml`. Cached by default.

### Per-Model SEO (Database)

[](#per-model-seo-database)

Publish the migration first:

```
php artisan vendor:publish --tag=seoquent-migrations
php artisan migrate
```

Add the trait to your model:

```
use IbrahimEng12\Seoquent\Traits\HasSeo;

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

Save SEO data:

```
$post->setSeo([
    'title' => 'Custom SEO Title',
    'description' => 'Custom description',
    'og_image' => 'https://example.com/image.jpg',
    'keywords' => ['laravel', 'seo'],
]);
```

Apply it in your controller:

```
public function show(Post $post)
{
    $post->applySeo(); // loads all stored SEO data into Seoquent

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

Delete SEO data:

```
$post->deleteSeo();
```

---

Blade Directives
----------------

[](#blade-directives)

```
@seoHead      {{-- meta + open graph + twitter cards --}}
@seoJsonLd    {{-- JSON-LD structured data --}}
```

Or use Blade components:

```

```

---

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

[](#configuration)

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

All defaults can be set in `config/seoquent.php`:

```
'defaults' => [
    'title'           => env('APP_NAME', 'Laravel'),
    'title_separator' => ' | ',
    'title_suffix'    => env('APP_NAME', 'Laravel'),
    'description'     => '',
    'robots'          => 'index, follow',
],

'open_graph' => [
    'type'      => 'website',
    'site_name' => env('APP_NAME'),
    'image'     => null,  // default OG image for all pages
],

'twitter' => [
    'card'    => 'summary_large_image',
    'site'    => null,  // @username
    'creator' => null,  // @username
],

'sitemap' => [
    'enabled'        => true,
    'cache_enabled'  => true,
    'cache_duration' => 3600,
],

'robots' => [
    'enabled'  => true,
    'allow'    => ['/'],
    'disallow' => [],
],

'database' => [
    'enabled'    => true,
    'table_name' => 'seo_meta',
],
```

---

Publishing
----------

[](#publishing)

```
php artisan vendor:publish --tag=seoquent-config       # Config
php artisan vendor:publish --tag=seoquent-migrations    # Migration
php artisan vendor:publish --tag=seoquent-views         # Blade views
```

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

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12

License
-------

[](#license)

MIT - See [LICENSE](LICENSE)

###  Health Score

40

—

FairBetter than 87% of packages

Maintenance88

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

88d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/05baae4a5e538a69414ac964017d9d79d2550691708f804d1a0de699e53c62e5?d=identicon)[ibrahim-eng12](/maintainers/ibrahim-eng12)

---

Top Contributors

[![ibrahim-eng12](https://avatars.githubusercontent.com/u/126605683?v=4)](https://github.com/ibrahim-eng12 "ibrahim-eng12 (4 commits)")

---

Tags

laravelrobots-txtJSON-LDSitemapseostructured-dataschema-orgopen-graphmeta-tagstwitter cardsseoquent

### Embed Badge

![Health badge](/badges/ibrahim-eng12-seoquent/health.svg)

```
[![Health](https://phpackages.com/badges/ibrahim-eng12-seoquent/health.svg)](https://phpackages.com/packages/ibrahim-eng12-seoquent)
```

###  Alternatives

[larament/seokit

A complete SEO package for Laravel, covering everything from meta tags to social sharing and structured data.

411.9k](/packages/larament-seokit)[devrabiul/laravel-seo-manager

Laravel SEO Manager is an SEO tool that improves SEO by adding recommended meta tags.

404.8k](/packages/devrabiul-laravel-seo-manager)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[fomvasss/laravel-meta-tags

A package to manage SEO (meta-tags, xml-fields, etc.)

3028.9k](/packages/fomvasss-laravel-meta-tags)[zonneplan/laravel-module-loader

Module loader for Laravel

24118.4k](/packages/zonneplan-laravel-module-loader)[pedroborges/meta-tags

HTML meta tags generator for PHP.

4628.6k1](/packages/pedroborges-meta-tags)

PHPackages © 2026

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