1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-24 11:22:42 +01:00

Entities hooks

This commit is contained in:
FreeScout 2022-12-06 22:39:42 -08:00
parent ae861da89d
commit 66d45bf7f6
3 changed files with 20 additions and 0 deletions

View File

@ -37,5 +37,12 @@ class ConversationObserver
public function deleting(Conversation $conversation) public function deleting(Conversation $conversation)
{ {
$conversation->threads()->delete(); $conversation->threads()->delete();
\Eventy::action('conversation.deleting', $conversation);
}
public function updated(Conversation $conversation)
{
\Eventy::action('conversation.updated', $conversation);
} }
} }

View File

@ -74,5 +74,17 @@ class ThreadObserver
) { ) {
Conversation::refreshConversations($conversation, $thread); 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);
} }
} }

View File

@ -56,6 +56,7 @@ class Thread extends Model
//self::TYPE_FORWARDPARENT => 'forwardparent', //self::TYPE_FORWARDPARENT => 'forwardparent',
// forwardchild is the type set on the first thread of the new forwarded conversation. // forwardchild is the type set on the first thread of the new forwarded conversation.
//self::TYPE_FORWARDCHILD => 'forwardchild', //self::TYPE_FORWARDCHILD => 'forwardchild',
// Not used.
self::TYPE_CHAT => 'chat', self::TYPE_CHAT => 'chat',
]; ];