๐Ÿ” Meta Tags

Larasonic provides enhanced meta tags capabilities beyond standard Inertia.js head management by leveraging Unhead.js under the hood. This gives you more powerful and flexible SEO management across your application.

If you prefer a simpler approach, you can still use Laravel Inertiaโ€™s default Head component to manage titles and meta tags. See the Inertia.js documentation for details.

๐Ÿš€ Usage

Larasonic provides a convenient useSeoMetaTags composable for managing SEO meta tags - itโ€™s a wrapper around useSeoMeta from the UnHead library so feel free to customize it to your needs:

import { useSeoMetaTags } from '@/Composables/useSeoMetaTags.js'

// Use default SEO meta tags
useSeoMetaTags()

// Override specific meta tags
useSeoMetaTags({
  title: 'My Page',
  description: 'Page description',
  ogImage: '/path/to/image.jpg'
})

// Complete custom SEO without defaults
useSeoMetaTags({
  title: 'Custom Page',
  description: 'Custom description'
}, { merge: false })

Default SEO meta tags can be configured in resources/js/Composables/useSeoMetaTags.js

โš™๏ธ Configuration

The useSeoMetaTags composable accepts two parameters:

  • seoMeta (object|null): Custom SEO meta tags to apply
  • options (object):
    • merge (boolean): When true, merges custom meta tags with defaults. When false, only uses provided meta tags.

๐Ÿท๏ธ Supported Meta Tags

Larasonic supports all meta & title tags from unhead including:

  • Basic meta tags (title, description)
  • Open Graph tags (og:title, og:description, og:image, etc)
  • Twitter Card tags (twitter:card, twitter:title, etc)
  • Robots directives
  • And more

๐Ÿ”„ Backend Integration

You can also manage SEO tags by passing them from your Laravel backend. Hereโ€™s how:

public function index()
{
    return Inertia::render('Welcome', [
        'canLogin' => Route::has('login'),
        'canRegister' => Route::has('register'),
        'seo' => [
            'title' => 'Welcome to My App',
            'description' => 'A Laravel application with powerful SEO capabilities',
            'ogImage' => asset('images/og-image.jpg')
        ]
    ]);
}

This approach allows you to:

  • Generate dynamic SEO tags based on your backend data
  • Reuse existing backend logic for SEO
  • Maintain consistency between backend and frontend SEO management

๐Ÿค– AI-Powered SEO Generation

Larasonic has partnered with SEOExpert to provide AI-powered SEO meta tag generation. This integration helps you:

  • Keyword Research - Scrape your website or competitorโ€™s to discover high-volume, low-competition keywords that can drive targeted traffic to your pages.
  • Content Planning - Analyze top-ranking pages to understand search intent and create topics and outlines for your chosen keywords.
  • Content Creation - Research information from multiple sources to create accurate and informative content that resonates with your audience.
  • Link Building - Share published content on social media and relevant forums like Reddit to build quality backlinks and increase visibility.

Try it out at app.tryseoexpert.com to supercharge your SEO efforts.

For Good SEO and Search Engine indexing, itโ€™s crucial to have Sitemap. check out sitemap for more details.