Force the form reset in the options, e.g.
onSuccess: () => form.reset()
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a Team model that contains Users. The Team page shows information about the team, including it's users and has a button to add a user to that team.
The page layout looks something like this:
<script setup>
...
const props = defineProps({
team: Object
});
const form = useForm({
name: props.team.name,
...
users: props.team.users
});
</script>
<template>
<div class="space-y-2" v-else>
<div v-for="(user, userIdx) in form.users" :key="userIdx">
...
</div>
</div>
</template>
When I add a user (which is just a form.post request to a controller that performs a redirect()->back() action when finished, the form is not updated and the list does not show the newly created user. How do I make this form reactive? My guess would be to add a watcher to the props, but that doesn't work. I can't think of any other clean solution.
Please or to participate in this conversation.