ralphjsmit/laravel-seo
Out-of-the-box SEO for Laravel models: automatically generates title, meta, OpenGraph, Twitter, structured data, robots, alternates and favicon tags. Store per-model SEO or derive it dynamically, then render everything with a simple seo()->for($model) call.
Pros:
getDynamicSEOData(), enabling real-time updates without manual DB writes.Cons:
HasSEO trait for full functionality, which may not fit headless or API-first architectures.{!! seo() !!} directives, limiting use in non-Blade contexts (e.g., API responses, SSR frameworks like Inertia).robots, title.suffix) require upfront setup, which may not align with all project needs.spatie/laravel-sitemap separately).{!! seo() !!} to layouts. Works out-of-the-box for simple sites.getDynamicSEOData() in models or manually updating associated SEO models.AlternateTag), or non-Eloquent data sources demand additional logic.HasSEO) adds initial complexity.getDynamicSEOData()) may introduce runtime overhead if not optimized (e.g., lazy-loading model properties).SchemaCollection) require familiarity with JSON-LD to avoid misconfiguration.secure_url(): Favicon/image paths must be publicly accessible, which may conflict with storage setups (e.g., S3).SEO models) or dynamic (generated via getDynamicSEOData())?author, image in dynamic data)?AlternateTag for hreflang? If so, how will you manage language-specific SEO data?getDynamicSEOData(), integration tests for Blade rendering)?title.suffix, robots.default) as requirements evolve?getDynamicSEOData(); static pages use SEO models").composer require ralphjsmit/laravel-seo
php artisan vendor:publish --tag="seo-migrations"
php artisan vendor:publish --tag="seo-config"
php artisan migrate
config/seo.php with site-wide defaults (e.g., site_name, title.suffix, robots).favicon, sitemap, and fallback values (e.g., description.fallback).HasSEO trait to relevant models (e.g., Post, Page).getDynamicSEOData() for models needing runtime SEO generation.{!! seo()->for($model) !!} in Blade layouts.{!! seo($SEOData) !!} with manually constructed SEOData.Article, FAQPage) using SchemaCollection in getDynamicSEOData().getDynamicSEOData() logic.composer.json for exact compatibility).spatie/laravel-head).spatie/laravel-sitemap, spatie/laravel-media-library, and inertiajs/inertia-laravel.seos table (published via migrations). Supports MySQL, PostgreSQL, SQLite.Post).getDynamicSEOData() for models needing runtime generation.image, fallback values).AlternateTag).config/seo.php, making updates easy.Post title changes auto-update SEO).SEOManager::SEODataTransformer() or middleware.published_time to SEO model) require migrations.getDynamicSEOData() methods may need updates if model structures change.dd(seo()->for($model)->toArray()) to inspect generated tags.image in SEOData).How can I help you explore Laravel packages today?