Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

matheusronanabel's avatar

Filament alert or notification when users wants to go back to previous window / url.

Hi! I'm new to FilamentPHP and I'm currently exploring its features and functionalities. I noticed that when I tried to go to https://demo.filamentphp.com/shop/products/products/create . When I'm halfway done to create a product, and I want to go back to other route / url, the app shows me an alert something like:

Leave site? Changes you made may not be saved.

Any ideas on how to recreate those notification?

Thanks in advance.

0 likes
5 replies
_hiro's avatar

To recreate the "Leave site? Changes you made may not be saved" alert in FilamentPHP, you can use JavaScript's beforeunload event. This event triggers a confirmation dialog when the user tries to navigate away from the page with unsaved changes.

Best Regards

shaungbhone's avatar
Level 28

You can use ->unsavedChangesAlerts() in the admin provider.

Please or to participate in this conversation.