artesaos/seotools
SEOTools adds SEO helpers for Laravel and Lumen: quickly set page titles, meta tags, Open Graph, Twitter Cards, and JSON-LD structured data via a simple, friendly API. Supports modern Laravel versions with package discovery.
SEOMeta, OpenGraph, JsonLd) while offering a unified facade (SEOTools) for cohesive management. This aligns with Laravel’s service-layer patterns and dependency injection.vendor:publish (or manual config copy for Lumen) is standard Laravel workflow. No invasive changes to core files.<head> via Blade directives (@inject) or service binding, requiring minimal template modifications.Post model → dynamic SEOMeta in show()). Works seamlessly with Laravel’s routing and resource controllers.@seo directive for DRY template SEO (e.g., @seo(['title' => $post->title])).^9.0 (latest stable) with dependency checks.app('seotools')) instead of facades. Mitigation: Document this in API-specific guides.JsonLdMulti) may need custom validation for edge cases (e.g., nested arrays). Mitigation: Unit tests for schema validation.SEOMeta::cache()) can optimize high-traffic routes.canonical tags can hurt rankings. Mitigation: Add validation middleware for critical routes.SEOMeta logic resides (controllers vs. model observers).OpenGraph::locale() and JsonLd::setLanguage() be managed?Product, Event) beyond the package’s defaults? If yes, will they require custom facades?SEOMeta interact with Laravel’s experiment system?@inject or @seo directives. Example:
@inject('seo', 'seotools')
@seo(['title' => $post->title])
SEOTools::generate() to embed meta tags in HTTP headers (e.g., Link: <https://example.com>; rel="canonical").SEOMeta::setTitle() in jobs.Phase 1: Core Integration
php artisan vendor:publish).config/app.php.<head> for key routes.Phase 2: Dynamic SEO
PostObserver updates SEOMeta on saved).class PostObserver {
public function saved(Post $post) {
SEOMeta::setTitle($post->title);
OpenGraph::setImage($post->cover_url);
}
}
Phase 3: Advanced Features
JsonLdMulti for complex pages (e.g., blog posts + author profiles).Cache::remember()).SEOMetaMiddleware to enforce canonical tags or validate schemas.SEOMeta::setTitle() with @seo for templates.Phase 4: Monitoring & Optimization
bootstrap/providers.php is updated.composer.json constraints).document.head.innerHTML).SEOTools via service providers or plugins.| Step | Priority | Dependencies | Output |
|---|---|---|---|
| Install & Configure | Critical | Composer, Laravel 5.8+ | Published config, provider registered |
| Basic Meta Tags | High | Blade templates, controllers | Static meta tags in <head> |
| Dynamic Model SEO | Medium | Eloquent models, observers | Auto-updated meta tags |
| OpenGraph/Twitter | High | Social media sharing requirements | Valid OG/Twitter Cards |
| JSON-LD Implementation | High | Schema.org requirements | Structured data in <script type> |
| Caching Layer | Low | Redis/Memcached | Reduced DB/model calls |
| Middleware Validation | Low | Custom SEO rules | Enforced canonical/tags |
| Monitoring | Low | GSC API, Laravel Telescope | SEO performance metrics |
seotools.php reduces config sprawl, but custom properties (e.g., OpenGraph::addProperty()) may require documentation.composer why-not artesaos/seotools:^9.0 to check constraints.Product properties), extend the package via custom facades or traits.How can I help you explore Laravel packages today?