From 64462cdb94cf445d43f63dcc0d42e24d8d5b531b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 30 Apr 2019 22:41:38 -0600 Subject: [PATCH] Add NotificationObserver --- app/Observers/NotificationObserver.php | 64 ++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 app/Observers/NotificationObserver.php diff --git a/app/Observers/NotificationObserver.php b/app/Observers/NotificationObserver.php new file mode 100644 index 000000000..7cc91a853 --- /dev/null +++ b/app/Observers/NotificationObserver.php @@ -0,0 +1,64 @@ +profile_id, $notification->id); + } + + /** + * Handle the notification "updated" event. + * + * @param \App\Notification $notification + * @return void + */ + public function updated(Notification $notification) + { + NotificationService::set($notification->profile_id, $notification->id); + } + + /** + * Handle the notification "deleted" event. + * + * @param \App\Notification $notification + * @return void + */ + public function deleted(Notification $notification) + { + NotificationService::del($notification->profile_id, $notification->id); + } + + /** + * Handle the notification "restored" event. + * + * @param \App\Notification $notification + * @return void + */ + public function restored(Notification $notification) + { + NotificationService::set($notification->profile_id, $notification->id); + } + + /** + * Handle the notification "force deleted" event. + * + * @param \App\Notification $notification + * @return void + */ + public function forceDeleted(Notification $notification) + { + NotificationService::del($notification->profile_id, $notification->id); + } +}