# Share a prop with every Inertia page

> HandleInertiaRequests::share() runs for every Inertia response. Keep the query cheap and leave secrets out.

- URL: https://laravel-vuejs.space/inertia-shared-props-vue
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs, Inertia

People searching “Inertia shared data Vue” put a post query in `share()` and then every page loads it, including the login screen. The [setup guide](https://laravel-vuejs.space/application-setup) already shares `auth.user`. Add one more value only when every page needs it.

> **TL;DR**
>
> -   HandleInertiaRequests::share() runs for every Inertia response.
> -   Keep the query cheap and leave secrets out.
> -   Do not share `$request->user()` a second time under another key.
> -   Do not share an API token.
>
> **Who it's for:** Laravel + Vue developers on Inertia
>
> **Applies to:** Laravel 13 · Inertia 3 · Vue 3

## The fix

```php
public function share(Request $request): array
{
    return [
        ...parent::share($request),
        'appName' => config('app.name'),
    ];
}
```

Read it from the page object:

```vue
<script setup lang="ts">
import { usePage } from "@inertiajs/vue3";

const page = usePage();
</script>

<template>
  <p>{{ page.props.appName }}</p>
</template>
```

A list of posts belongs on the controller that renders the list, not here. A shared closure should be lazy when the work is heavy, so a response that does not read the prop does not run it.

## What to avoid

> **Gotcha**
>
> Do not share `$request->user()` a second time under another key. The kit already did it. Do not share an API token. Shared props are in the HTML of every visit.

## FAQ

**Q: How do I share a prop with every Inertia page?**

HandleInertiaRequests::share() runs for every Inertia response. Keep the query cheap and leave secrets out.

**Q: What goes wrong with Inertia shared data Vue?**

Many developers put a post query in `share()` and then every page loads it, including the login screen. Do not share `$request->user()` a second time under another key.
