소스 검색

container_count

peterguo 1 개월 전
부모
커밋
a6877f7bda
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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'])