Route::get('/test-products-ajax', function() {
    $tenant = app('tenant');
    $totalRecords = \App\Models\Product::where('tenant_id', $tenant->id)->count();
    $totalPhones = \App\Models\Product::where('tenant_id', $tenant->id)->where('type', 'Phone')->count();
    $totalAccessories = \App\Models\Product::where('tenant_id', $tenant->id)->where('type', 'Accessories')->count();
    
    return response()->json([
        'recordsTotal' => $totalRecords,
        'totalPhones' => $totalPhones,
        'totalAccessories' => $totalAccessories,
        'debug' => 'Test successful'
    ]);
});