3 namespace BookStack\Activity\Controllers;
5 use BookStack\Activity\Models\Activity;
6 use BookStack\Http\ApiController;
8 class AuditLogApiController extends ApiController
11 * Get a listing of audit log events in the system.
12 * The loggable relation fields currently only relates to core
13 * content types (page, book, bookshelf, chapter) but this may be
14 * used more in the future across other types.
15 * Requires permission to manage both users and system settings.
17 public function list()
19 $this->checkPermission('settings-manage');
20 $this->checkPermission('users-manage');
22 $query = Activity::query()->with(['user']);
24 return $this->apiListingResponse($query, [
25 'id', 'type', 'detail', 'user_id', 'loggable_id', 'loggable_type', 'ip', 'created_at',