diff --git a/app/Observers/ConversationObserver.php b/app/Observers/ConversationObserver.php index 419f0afd..ee46d358 100644 --- a/app/Observers/ConversationObserver.php +++ b/app/Observers/ConversationObserver.php @@ -37,5 +37,12 @@ class ConversationObserver public function deleting(Conversation $conversation) { $conversation->threads()->delete(); + + \Eventy::action('conversation.deleting', $conversation); + } + + public function updated(Conversation $conversation) + { + \Eventy::action('conversation.updated', $conversation); } } diff --git a/app/Observers/ThreadObserver.php b/app/Observers/ThreadObserver.php index 637e510e..24549860 100644 --- a/app/Observers/ThreadObserver.php +++ b/app/Observers/ThreadObserver.php @@ -74,5 +74,17 @@ class ThreadObserver ) { Conversation::refreshConversations($conversation, $thread); } + + \Eventy::action('thread.created', $thread); + } + + public function deleting(Thread $thread) + { + \Eventy::action('thread.deleting', $thread); + } + + public function updated(Thread $thread) + { + \Eventy::action('thread.updated', $thread); } } diff --git a/app/Thread.php b/app/Thread.php index 81ac2e22..3fd015a3 100644 --- a/app/Thread.php +++ b/app/Thread.php @@ -56,6 +56,7 @@ class Thread extends Model //self::TYPE_FORWARDPARENT => 'forwardparent', // forwardchild is the type set on the first thread of the new forwarded conversation. //self::TYPE_FORWARDCHILD => 'forwardchild', + // Not used. self::TYPE_CHAT => 'chat', ];