Home / Snippets / How to Prevent From Accidentally closing Laravel Nova Resource?
How to Prevent From Accidentally closing Laravel Nova Resource? cover

How to Prevent From Accidentally closing Laravel Nova Resource?

357

3 years ago

0 comments

To prevent accidentally closing the Laravel Nova resources page during creating or editing content, you have to set the "preventFormAbandonment" properties to true. By doing so, when any misclick that may lead to closing the page will be prevented and a confirmation form will be displayed.

/**
 * Indicates whether Nova should prevent the user from leaving an unsaved form, losing their data.
 *
 * @var bool
 */
public static $preventFormAbandonment = true;
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this