Am using this in vue layout with UserProfileComponent.it's works properly.But when user update
profile photo or name it's not auto updating.I have to reload the page.After reload the page it's working.
Since you're updating the profile within Vue, the data in Inertia's global shared state does not automatically update. As a solution you can use Inertia’s reload method to partial reload the page. Exemple:
import { Inertia } from '@inertiajs/inertia';
async function updateProfile() {
try {
await axios.post('/profile/update', formData); // Replace with actual API call
Inertia.reload({ only: ['auth'] }); // Reload only the 'auth' shared prop
} catch (error) {
console.error('Error updating profile: ', error);
}
}
@naimul007a You shouldnt need to use Inertia.reload. Check the network tab of the browser and notice that it redirects you and adds the properties to the response. Check if the updated auth is there..