serviceService = $serviceService; $this->serviceRepository = $serviceRepository; } public function getService(Request $request) { $limit = $request->get('limit', 10); $services = $this->serviceService->getActiveServices($limit); return ServiceListResource::collection($services)->additional([ 'error' => false, 'message' => 'Lấy dữ liệu thành công', 'page_type' => 'service', ]); } public function getDetailService(Product $product) { $product->load([ 'osVersions.osGroup', 'category', 'pricings' => fn($q) => $q->where('is_active', 1), 'addons' ]); return response()->json([ 'error' => false, 'message' => 'Lấy dữ liệu thành công', 'page_type' => 'service', 'data' => new ServiceResource($product), ]); } }