where('ticket_id', $ticketId) ->orderBy('created_at', 'asc') ->get(); } public function create(int $ticketId, int $userId, string $reply): SupportReply { $model = SupportReply::create([ 'ticket_id' => $ticketId, 'user_id' => $userId, 'reply' => $reply, ]); return $model->load('user'); } public function update(int $ticketId, int $id, string $reply): SupportReply { $model = SupportReply::where('ticket_id', $ticketId)->findOrFail($id); $model->update(['reply' => $reply]); return $model->load('user'); } public function delete(int $ticketId, int $id): bool { $model = SupportReply::where('ticket_id', $ticketId)->findOrFail($id); return $model->delete(); } }