- How do I install artesaos/seotools in Laravel 5.5+?
- Run `composer require artesaos/seotools`—Laravel 5.5+ supports package discovery, so no manual provider/alias registration is needed. For Laravel 11+, update `bootstrap/providers.php` instead of `config/app.php`.
- Does this package work with Lumen?
- Yes, but facades won’t work. Use dependency injection (e.g., `app('seotools')`) or the service container directly. Lumen’s lightweight nature is supported, but some Laravel-specific features like facades are unavailable.
- Can I use this for JSON-LD structured data?
- Absolutely. The package provides a `JsonLd` facade to generate Schema.org-compliant JSON-LD markup. It’s ideal for rich snippets, but validate output using Google’s Rich Results Test or similar tools.
- How do I dynamically set SEO tags per route in Laravel?
- Use middleware to auto-generate tags based on route parameters. For example, inject `SEOMeta` in middleware and set dynamic titles/meta tags before rendering the view. Cache results if performance is critical.
- Will this work with SPAs like React or Vue?
- For server-side rendering (SSR), it works seamlessly. For client-side SPAs, consider hybrid approaches: use Laravel to generate initial meta tags, then hydrate them client-side with libraries like `react-helmet` or `next/head`.
- Are there performance concerns with generating SEO tags on every request?
- Yes, generating JSON-LD or Open Graph tags per request can add overhead. Cache tags using Laravel’s `@cache` directives or middleware caching to mitigate this. Test under load to ensure responsiveness.
- How do I validate SEO tags after implementation?
- Use automated tests to verify meta tags in Blade views. For JSON-LD, integrate with Google’s Rich Results Test API or third-party tools like Screaming Frog. Monitor post-deployment with Google Search Console or Analytics.
- Can I extend this for LinkedIn or Pinterest tags?
- The package focuses on Open Graph and Twitter Cards. For LinkedIn or Pinterest, manually add their specific meta tags (e.g., `link:profile` for LinkedIn) alongside the existing Open Graph tags or create a custom facade.
- What Laravel versions are supported?
- The package supports Laravel 5.8+ and Lumen. Check the [GitHub repo](https://github.com/artesaos/seotools) for the latest version compatibility. Always test in a staging environment before upgrading.
- How do I integrate this with a headless CMS like Strapi?
- Expose SEO tag generation via API endpoints (e.g., `/api/seo-tags?slug=post-title`). Use the package’s facades or service container in your API routes, then cache responses aggressively to avoid redundant processing.