fix: deep link

This commit is contained in:
2026-09-02 11:16:03 +03:30
parent a3cda12560
commit 78ea663c2b
4 changed files with 37 additions and 15 deletions
@@ -9,7 +9,7 @@ class SubCategoryController extends Controller
{
public function index(Request $request, $categoryId = null)
{
$query = SubCategory::with('category')->withCount('media');
$query = SubCategory::with('category')->withCount(['media' => fn ($q) => $q->where('is_deeplink_only', false)]);
$categoryId = $categoryId ?? $request->input('category_id');
@@ -51,7 +51,7 @@ public function store(Request $request)
public function show($id)
{
$subCategory = SubCategory::with('category')->withCount('media')->findOrFail($id);
$subCategory = SubCategory::with('category')->withCount(['media' => fn ($q) => $q->where('is_deeplink_only', false)])->findOrFail($id);
return response()->json($subCategory);
}