feat: Implement pagination for active services and introduce ServiceListResource for formatted API output.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user