| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentSupport\App\Hooks\Handlers; |
| 4 |
|
| 5 |
use FluentSupport\App\Models\Agent; |
| 6 |
use FluentSupport\App\Models\Ticket; |
| 7 |
|
| 8 |
class AsyncActionHandler |
| 9 |
{ |
| 10 |
public function resolveAgentAssigned($agentId, $ticketId, $assignerId, $previousAgentId = 0) |
| 11 |
{ |
| 12 |
$agent = Agent::find($agentId); |
| 13 |
$ticket = Ticket::find($ticketId); |
| 14 |
$assigner = Agent::find($assignerId); |
| 15 |
|
| 16 |
if ($agent && $ticket) { |
| 17 |
do_action('fluent_support/agent_assigned_to_ticket', $agent, $ticket, $assigner ?: $agent, $previousAgentId); |
| 18 |
} |
| 19 |
} |
| 20 |
} |
| 21 |
|