Browse Source

container_count

peterguo 1 month ago
parent
commit
a6877f7bda
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/Http/Controllers/API/LibraryController.php

+ 1 - 1
app/Http/Controllers/API/LibraryController.php

@@ -117,7 +117,7 @@ class LibraryController extends Controller
             LibraryType::CUSTOM => []
         };
 
-        $libraries = Library::query()
+        $libraries = Library::withCount('container')
             ->allowed()
             ->where("type", $type)->when($where, fn($query) => $query->where($where))
             ->get(['id', 'name', 'created_at', 'updated_at'])