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

cjholowatyj's avatar

Canonical URL for SEO in Laravel / Inertia+SSR / Vue

I'm trying to get a canonical url working in my Laravel 10 / Inertia 1 (with SSR) / Vue 3 app using the <Head> component from Inertia...

I've tried accessing both Inertia.initialPage.url and usePage().props.url both without success because the properties of Router are protected...

I've also tried route(route().current()) but then I run into the problem of routes that have route props vs ones that don't.

Is there a built-in way to retrieve a url that can be used for canonical purposes, or do I have to code that as an additional prop starting in Laravel?

0 likes
0 replies

Please or to participate in this conversation.