feat: Implement pagination for active services and introduce ServiceListResource for formatted API output.

This commit is contained in:
pbao9
2026-02-11 11:32:45 +07:00
parent 6b6385f441
commit 8ecea7badc
5 changed files with 60 additions and 9 deletions
@@ -15,13 +15,13 @@ class ServiceRepository extends BaseApiRepository implements ServiceRepositoryIn
/**
* Lấy danh sách sản phẩm đang hoạt động
*/
public function getActiveServices()
public function getActiveServices(int $limit = 10)
{
return $this->model
->with(['osVersions.osGroup', 'category'])
->where('is_active', 1)
->orderBy('sort_order', 'asc')
->get();
->paginate($limit);
}
public function findActiveBySlug(string $slug)