feat: Add active pricing details to service list resource and eager load only active pricings in the service repository.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user