diff --git a/resources/views/tickets/supporters.blade.php b/resources/views/tickets/supporters.blade.php deleted file mode 100644 index e69de29..0000000 diff --git a/src/Observers/TicketMessageObserver.php b/src/Observers/TicketMessageObserver.php index 808e49e..9351cf1 100644 --- a/src/Observers/TicketMessageObserver.php +++ b/src/Observers/TicketMessageObserver.php @@ -20,13 +20,13 @@ public function created(TicketMessage $ticketMessage) $ticketActivity->targetable()->associate($ticketMessage); $ticketActivity->save(); - $ticket = $ticketMessage->ticket; + $ticket = $ticketMessage->ticket()->first(); if ($ticketMessage->user_id != $ticket->user_id) { $ticket->update([ 'state' => 'ANSWERED' ]); } - event(new TicketMessageEvent($ticketMessage->ticket()->first(), $ticketMessage)); + event(new TicketMessageEvent($ticket, $ticketMessage)); } public function deleting(TicketMessage $ticketMessage)