Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

freemium's avatar

artesaos seotools use in inertia vue

how can we use https://github.com/artesaos/seotools with inertia vue laravel

in app.blade.php

  <!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">

<head>
      {!! SEO::generate() !!}
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title inertia>{{ config('app.name', 'Laravel') }}</title>


    <!-- Styles -->
    <link rel="stylesheet" href="{{ mix('css/app.css') }}">

  
    @routes
    <script src="{{ mix('js/app.js') }}" defer></script>
</head>

<body style="font-family: 'Roboto', sans-serif;">
    @inertia


</body>

</html>

//method for all posts

 public function index()
    {
        SEOTools::setTitle('post dashboard');
        SEOTools::setDescription('Learning laravel vue inertia');
        SEOTools::opengraph()->setUrl(url()->current());
        SEOTools::setCanonical(url()->current());
        SEOTools::opengraph()->addProperty('type', 'articles');
        SEOTools::twitter()->setSite('@kumaranil60');
        SEOTools::jsonLd()->addImage('/allimage/anil.jpg');

        $posts = Post::with('category')->get();

        return Inertia::render('Dashboard/Post/Index', [
            'posts' => $posts
        ]);
        //
    }

with normal blade we all know it works but i am learning laravel with inertia and vue so i just wanted to learn this tool too

0 likes
9 replies
Sinnbeck's avatar

That package seems to be made for use with views. Inertia does not return views, so I doubt you can get it working

What sort of error are you getting?

freemium's avatar

@Sinnbeck i am not getting any error tags required for seo doesnt changes .... can we use {!! SEO::generate() !!} inside vue tempale file ..

Sinnbeck's avatar

@freemium that you will need to do. Inertia is a single page so your blade code won't reload on page change. That's why I linked to ssr above

freemium's avatar

@Sinnbeck sir what can be the solution if we want to have working like that artesaos seotools in my case

Sinnbeck's avatar

@freemium read the article posted by tray2. You probably don't need a package like that

Please or to participate in this conversation.