1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6namespace App\Http\Controllers\Forum;
7
8use App\Models\Forum\Topic;
9use App\Models\Log;
10
11class TopicLogsController extends Controller
12{
13 public function index($topicId)
14 {
15 $topic = Topic::withTrashed()->findOrFail($topicId);
16
17 priv_check('ForumModerate', $topic->forum)->ensureCan();
18
19 $logs = $topic->logs()
20 ->where('log_type', Log::LOG_FORUM_MOD)
21 ->orderByDesc('log_time')
22 ->paginate();
23
24 return ext_view('forum.topics.logs.index', compact('logs', 'topic'));
25 }
26}