From 0097ad3f3b01fc0e750ae26764b1f0430defa71b Mon Sep 17 00:00:00 2001 From: Tajim Date: Sat, 12 Sep 2026 09:23:42 +0600 Subject: [PATCH 1/3] feat: show toast notification on form validation error --- resources/js/components/ToastNotification.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/resources/js/components/ToastNotification.vue b/resources/js/components/ToastNotification.vue index 51daa6fa..0bad2254 100644 --- a/resources/js/components/ToastNotification.vue +++ b/resources/js/components/ToastNotification.vue @@ -44,6 +44,22 @@ watch( }, { deep: true, immediate: true }, ); + +// Watch Inertia page errors for validation failures +watch( + () => page.props.errors, + (errors: any) => { + const errorKeys = Object.keys(errors || {}); + + if (errorKeys.length > 0) { + addToast( + 'Validation failed. Please check the form for errors.', + 'error', + ); + } + }, + { deep: true }, +);