@max100 can you show how did you write the code? Basically you just need to share data from HandleInertiaRequests and access it from every page with $page.props.
Accessing User data in Breeze/vue page
I'm using Breeze/Vue with inertia and trying to add a conditional menu item in the AuthenticatedLayout.vue
I'd like to use a div with v-if to display the menu item if the user.user_type == 'Admin', but I can not get it to see the user.user_type.
I tried following the instructions for accessing shared data as explained in https://inertiajs.com/shared-data#sharing-data, but I keep getting an error: Cannot read properties of undefined (reading 'user').
I tried the line from the instructions: const user = computed(() => usePage().props.auth.user.user_type);
Using the DevTools, I can see the data is there, but it's not in props, it's listed under attrs>auth>user and I can't seem to access it.
How can I create a conditional menu item based on the user.user_type?
Please or to participate in this conversation.