Alert Before Unsaved Changes

alertBeforeUnsavedChanges

Argument
Type
Required
Default

status

bool

true

This feature is enabled by default and triggers an alert if a user attempts to navigate away or refresh the page without saving CKEditor content, just like other form fields in Nova.

use Mostafaznv\NovaCkEditor\CkEditor;

class Article extends Resource
{
    public function fields(Request $request): array
    {
        return [
            CkEditor::make(trans('Content'), 'content')
                ->alertBeforeUnsavedChanges()
        ];
    }
}

This feature has been available since v7.7.0

Last updated