Posts Learn Components Snippets Categories Tags Tools About
/

How to Prevent From Accidentally closing Laravel Nova Resource?

Learn how to prevent accidentally closing nova resources while creating or editing content

Created on Jul 07, 2021

155 views

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;

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

)