user(); $logs = ProductViewLog::with(['sku']) ->where('user_id', $user->id) ->whereHas('sku') ->latest('updated_at') ->simplePaginate(Paginator::resolvePerPage('per_page', 20, 50)); return ProductViewLogResource::collection($logs); } }