outl1ne / nova-notes-field

This Laravel Nova package adds a notes field to Nova's arsenal of fields.
MIT License
51 stars 36 forks source link

Feature request – emit event when creating? #42

Closed johnpuddephatt closed 2 years ago

johnpuddephatt commented 2 years ago

If an event were dispatched when a note is created (and destroyed) this would allow users of this package to listen for this event and carry out actions (such as sending an email notification to someone).

I'm happy to submit a pull request if you were interested.

KasparRosin commented 2 years ago

@johnpuddephatt Hey! :wave: You should be able to create a NoteObserver class and observe the Note model for basic events (creating, created, updated, destroyed etc.)

johnpuddephatt commented 2 years ago

ah yes thank you so much you're right!

sorry I'm still a little new to events and didn't realise this was possible... I'll close the issue but hopefully it may help anyone in future who has the same question.