|
|
@@ -15,7 +15,8 @@ public function getAll(): Collection
|
|
|
|
|
|
public function getByUnit(int $unitId): Collection
|
|
|
{
|
|
|
- return ClassPackage::whereHas('units', fn($q) => $q->where('units.id', $unitId)->where('visible', true))
|
|
|
+ return ClassPackage::with('products')
|
|
|
+ ->whereHas('units', fn($q) => $q->where('units.id', $unitId)->where('visible', true))
|
|
|
->orderBy('name')
|
|
|
->get();
|
|
|
}
|