On Document this is how to use
User::with([
'posts' => function ($query) {
$query->where('status', 'published');
},
'profile',
'roles.permissions'
])->cursor()->each(function ($user) {
// Process user with filtered posts, profile, and nested role permissions
foreach ($user->posts as $post) {
echo "Processing post: {$post->title}" . PHP_EOL;
}
});
but What i want to do is cant we just load all relations into cursor without each loading $user->posts ??