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

beycandeveloper's avatar

How do I send props to Laravel inertia vue js layout component.

I tried something like below but it didn't work :D

<template :title="title">
0 likes
4 replies
beycandeveloper's avatar

OK, I solved it. Instead of specifying it in the Component layout property, it should be used in the template.

<General :title="title">
        <h1>Welcome</h1>
        <p>Hello , welcome to your first Inertia app!</p>
    </General>
avorster's avatar

I am using Vue3 and Laravel 10 and inertia with a persistent layout. I could not get this to work so I tried chatgpt and it gave me a working solution. Not sure if this is the proper solution.

from a test page I can pass the title prop to the persistent layout and display it:

<script setup>
import { ref, onMounted  } from 'vue'
import { Link, usePage } from '@inertiajs/vue3'

onMounted(() => {
  const { props } = usePage();
  props.title = 'Child Page Title';
});
</script>
1 like
khippler's avatar

@avorster Seems like you are Chads favorite kid, because I only got nonsense. Your solution worked, thank you!

Please or to participate in this conversation.