outl1ne / nova-settings

A Laravel Nova tool for editing custom settings using native Nova fields.
MIT License
271 stars 99 forks source link

added events #156

Closed xfolder closed 1 year ago

xfolder commented 1 year ago

nova-settings-fields-loaded nova-settings-fields-updated

marttinnotta commented 1 year ago

Thank you for your contribution!

Before we can merge this PR I would like if those events would follow Nova own event naming.

Rename those events to resource-loaded and resource-updated and pass resourceName and mode properties inside object argument.

Example

Nova.$emit('resource-loaded', {
  resourceName: this.resourceName,
  mode: 'update',
})
Tarpsvo commented 1 year ago

Support added in version 5.1.0.

 // Dispatch event
      const eventName = this.isUpdating ? 'resource-updated' : 'resource-loaded';
      Nova.$emit(eventName, {
        resourceName: 'nova-settings',
      });