feat: Add active pricing details to service list resource and eager load only active pricings in the service repository.

This commit is contained in:
pbao9
2026-02-11 11:52:43 +07:00
parent 8ecea7badc
commit 58a9aa685b
2 changed files with 7 additions and 1 deletions
@@ -18,7 +18,7 @@ class ServiceRepository extends BaseApiRepository implements ServiceRepositoryIn
public function getActiveServices(int $limit = 10)
{
return $this->model
->with(['osVersions.osGroup', 'category'])
->with(['osVersions.osGroup', 'category', 'pricings' => fn($q) => $q->where('is_active', 1)])
->where('is_active', 1)
->orderBy('sort_order', 'asc')
->paginate($limit);