The issue with the second approach is that the $post variable is being modified by each subsequent query, so the final query is only returning the results of the featured() method.
One solution would be to use separate instances of the Post model for each query. This way, each query is independent and won't interfere with the others. Here's an example:
$pressrelease = Post::query()->pressReleases()->get();
$popular = Post::query()->popular()->get();
$featured = Post::query()->featured()->get();
Alternatively, you could use the clone keyword to create a copy of the $post variable for each query. This way, each query is working with a separate instance of the Post model. Here's an example:
$post = Post::query();
$pressrelease = clone $post;
$popular = clone $post;
$featured = clone $post;
$pressrelease = $pressrelease->pressReleases()->get();
$popular = $popular->popular()->get();
$featured = $featured->featured()->get();
Note that in the second approach, we're using the clone keyword to create separate instances of the $post variable for each query. Then, we're running each query on its own instance of the Post model.