fibonoir / laravel-seo
Rank Math Pro-style SEO suite for Laravel - Complete SEO management with content analysis, 32 SEO checks, sitemap generation, redirects, 404 monitoring, schema markup, and analytics integration.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/fibonoir/laravel-seo
Requires
- php: ^8.2
- illuminate/cache: ^11.0|^12.0
- illuminate/console: ^11.0|^12.0
- illuminate/database: ^11.0|^12.0
- illuminate/http: ^11.0|^12.0
- illuminate/routing: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
- wamania/php-stemmer: ^3.0
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^2.0|^3.0
Suggests
- google/apiclient: Integrate Google Analytics 4 data (^2.15)
- spatie/browsershot: Render JavaScript pages for scanning SPAs (^4.0)
- spatie/laravel-sitemap: Generate XML sitemaps for your models (^7.0)
This package is auto-updated.
Last update: 2026-01-13 16:46:18 UTC
README
A Rank Math Pro-style SEO suite for Laravel β complete with content analysis, 32 SEO checks, sitemap generation, redirect management, 404 monitoring, schema markup, and analytics integration.
β¨ Features
| Feature | Description |
|---|---|
| Per-page SEO Editor | Content editors can optimize each page without developer help |
| Real-time Content Analyzer | 32 SEO checks with instant feedback (keyword density, readability, etc.) |
| Sitewide Scanner | Find duplicate titles, missing meta, broken links across ALL pages |
| Redirect Manager | Handle URL changes with 301/302/410 redirects, regex support |
| 404 Monitor | Track missing pages and create redirects with one click |
| Schema Markup Builder | Article, FAQ, Breadcrumb, LocalBusiness, Product schemas |
| Sitemap Generation | Automatic XML sitemaps with index support for large sites |
| Analytics Integration | GA4 data right in your admin panel |
| Multi-keyword Support | Primary + secondary keywords with synonyms |
| Multilingual Ready | hreflang support for international sites |
π Requirements
- PHP 8.2 or higher
- Laravel 11.0 or higher
π Installation
composer require fibonoir/laravel-seo
Then run the interactive installer:
php artisan seo:install
The installer will:
- Detect your frontend stack (Filament, Livewire, Vue, or React)
- Publish appropriate configuration and components
- Run database migrations
- Set up initial defaults
π Quick Start
1. Add the HasSEO trait to your models
use Fibonoir\LaravelSEO\Traits\HasSEO; class Post extends Model { use HasSEO; }
2. Render SEO tags in your Blade layout
<head> @seo($post) </head>
Or for routes without models:
<head> @seoForRoute('home') </head>
3. Use the Facade for more control
use Fibonoir\LaravelSEO\Facades\SEO; // Get resolved SEO data $seoData = SEO::resolve($post); // Render as HTML $html = SEO::render($post); // Get as array for Vue/React $array = SEO::toArray($post);
π¨ Frontend Integration
Filament
SEO fields are automatically available in your Filament resources:
use App\Filament\Forms\Components\SEOFields; public static function form(Form $form): Form { return $form->schema([ // Your fields... SEOFields::make(), ]); }
Livewire
Include the SEO form component in your views:
<livewire:seo.seo-form :model="$post" />
Vue (with Inertia)
<script setup> import { useSEO } from '@/composables/useSEO' const props = defineProps({ seo: Object }) useSEO(props.seo) </script>
React (with Inertia)
import { useSEO } from '@/hooks/useSEO' export default function Page({ seo }) { useSEO(seo) return <div>...</div> }
π§ Configuration
Publish the configuration file:
php artisan vendor:publish --tag=seo-config
Key configuration options in config/seo.php:
return [ 'site_name' => env('APP_NAME'), 'title_suffix' => ' | ' . env('APP_NAME'), 'features' => [ 'analytics' => false, 'sitemap' => true, 'schema' => true, 'redirects' => true, '404_monitor' => true, ], 'analyzer' => [ 'min_content_length' => 300, 'keyword_density_range' => [1.0, 2.5], ], ];
π SEO Analysis
The package includes 32 SEO checks across 5 categories:
| Category | Checks |
|---|---|
| Focus Keyword | Density, in title/URL/description/headings/first paragraph, distribution |
| Meta & Title | Length checks, numbers, power words |
| Content Quality | Length, readability, heading structure, transitions, paragraphs |
| Media & Links | Alt tags, internal/external links, broken links/images |
| Technical SEO | Head elements, canonical, noindex, lang, OG image, HTTPS |
πΊοΈ Sitemap Generation
Generate your sitemap:
php artisan seo:sitemap
Configure models in config/seo.php:
'sitemap' => [ 'models' => [ \App\Models\Post::class => [ 'priority' => 0.8, 'changefreq' => 'weekly', ], ], ],
β©οΈ Redirects & 404 Monitoring
Apply the middleware globally or to specific routes:
// In bootstrap/app.php for Laravel 11+ ->withMiddleware(function (Middleware $middleware) { $middleware->prepend(\Fibonoir\LaravelSEO\Http\Middleware\RedirectMiddleware::class); $middleware->append(\Fibonoir\LaravelSEO\Http\Middleware\Log404Middleware::class); })
π₯ Health Check
Verify your installation:
php artisan seo:health
π Documentation
For full documentation, visit [documentation link].
π§ͺ Testing
composer test
π Changelog
Please see CHANGELOG for recent changes.
π€ Contributing
Please see CONTRIBUTING for details.
π Security
If you discover any security-related issues, please email security@example.com instead of using the issue tracker.
π License
The MIT License (MIT). Please see License File for more information.