]> BookStack Code Mirror - bookstack/blobdiff - app/Activity/Controllers/AuditLogController.php
ZIP Imports: Added API examples, finished testing
[bookstack] / app / Activity / Controllers / AuditLogController.php
index a90f45f3aa8f8615aad156b2b1a7b9dff22f1900..66ca301977ce35300cc26e0d196a5586e5975e5f 100644 (file)
@@ -4,7 +4,8 @@ namespace BookStack\Activity\Controllers;
 
 use BookStack\Activity\ActivityType;
 use BookStack\Activity\Models\Activity;
-use BookStack\Http\Controllers\Controller;
+use BookStack\Http\Controller;
+use BookStack\Sorting\SortUrl;
 use BookStack\Util\SimpleListOptions;
 use Illuminate\Http\Request;
 
@@ -32,7 +33,7 @@ class AuditLogController extends Controller
 
         $query = Activity::query()
             ->with([
-                'entity' => fn ($query) => $query->withTrashed(),
+                'loggable' => fn ($query) => $query->withTrashed(),
                 'user',
             ])
             ->orderBy($listOptions->getSort(), $listOptions->getOrder());
@@ -65,6 +66,7 @@ class AuditLogController extends Controller
             'filters'       => $filters,
             'listOptions'   => $listOptions,
             'activityTypes' => $types,
+            'filterSortUrl' => new SortUrl('settings/audit', array_filter($request->except('page')))
         ]);
     }
 }