[Vuejs]-Cannot change data when uploading images

0👍

That’s an issue with inertia form. put _method property in form and send a post request

const form = useForm({
 _method: 'put',
 title: props.post.title,
 slug: props.post.slug,
 image: props.post.image,
 body: props.post.body,
});



const update = () => {
form.post(route("posts.update", props.post.slug), {
    onSuccess: () => {
        form.reset();
        urlImage.value = null;
    },
    preserveScroll: true,
});
};

Leave a comment