Explorar el Código

container_count

peterguo hace 1 mes
padre
commit
a6877f7bda
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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'])