salesentry filters

This commit is contained in:
Sampanna Rimal
2024-09-17 16:34:40 +05:45
parent afb2c202d6
commit 0b438e302d
19 changed files with 303 additions and 50 deletions

View File

@ -148,4 +148,17 @@ class ProductController extends Controller
'data' => $productModel,
]);
}
public function getProductsByCategory(Request $request)
{
$categoryId = $request->category_id;
try {
$products = $this->productRepository->getProductsByCategory($categoryId);
} catch (\Throwable $th) {
toastr()->error($th->getMessage());
}
return response()->json(['products' => $products]);
}
}