In my use case I need a collection of children of all generations of a page plus the page itself. I found that $page->site() seems to give me what I need, but I’m hesitant if it is the correct approach. I first thought of using $page->index() and merging it with the page itself, but this would be easier.
So, does $page->site() indeed give me a collection, or is it just a happy accident that it works in my case?
$artist is a certain page and $results are search results.
Edit: Okay, I think I already found that $page->site() does not give me what I want after all. Question still stands: What is the site object? And what would be the best approach to get the wanted collection? Is there a method for it, or do I need to merge something?
The $site object represents the root of your site with all the information stored in /content/site.txt . It’s also the access point for registered users, available languages on multi-language sites and more.